fix(editor): 待办内容和学科判空逻辑错误
This commit is contained in:
parent
2837001a8b
commit
6f829d1825
1 changed files with 5 additions and 13 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in a new issue