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