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),
|
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(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue