From 6f829d1825e7ad047df76a77259128dc80ca1032 Mon Sep 17 00:00:00 2001 From: Super12138 <70494801+Super12138@users.noreply.github.com> Date: Fri, 21 Feb 2025 20:00:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(editor):=20=E5=BE=85=E5=8A=9E=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E5=92=8C=E5=AD=A6=E7=A7=91=E5=88=A4=E7=A9=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../todo/ui/pages/editor/TodoEditorPage.kt | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/app/src/main/kotlin/cn/super12138/todo/ui/pages/editor/TodoEditorPage.kt b/app/src/main/kotlin/cn/super12138/todo/ui/pages/editor/TodoEditorPage.kt index 336a189..df35bca 100644 --- a/app/src/main/kotlin/cn/super12138/todo/ui/pages/editor/TodoEditorPage.kt +++ b/app/src/main/kotlin/cn/super12138/todo/ui/pages/editor/TodoEditorPage.kt @@ -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(