fix(editor): 待办内容和学科判空逻辑错误

This commit is contained in:
Super12138 2025-02-21 20:00:16 +08:00
parent 2837001a8b
commit 6f829d1825

View file

@ -131,16 +131,10 @@ fun TodoEditorPage(
text = stringResource(R.string.action_save),
expanded = true,
onClick = {
if (toDoContent.trim().isEmpty()) {
isErrorContent = true
return@AnimatedExtendedFloatingActionButton
}
if (subjectContent.trim()
.isEmpty() && selectedSubjectId == Subjects.Custom.id
) {
isErrorSubject = true
return@AnimatedExtendedFloatingActionButton
}
isErrorContent = toDoContent.trim().isEmpty()
isErrorSubject = subjectContent.trim()
.isEmpty() && selectedSubjectId == Subjects.Custom.id
if (isErrorContent || isErrorSubject) return@AnimatedExtendedFloatingActionButton
isErrorContent = false
isErrorSubject = false
@ -163,9 +157,7 @@ fun TodoEditorPage(
}
}
},
onBack = {
checkModifiedBeforeBack()
},
onBack = { checkModifiedBeforeBack() },
modifier = modifier
) { innerPadding ->
Column(