From 4b926f199c9af38227a5e2123774b8d5b020b766 Mon Sep 17 00:00:00 2001 From: rhunk <101876869+rhunk@users.noreply.github.com> Date: Sat, 11 Nov 2023 23:43:15 +0100 Subject: [PATCH] fix(app/messaging_preview): constraints dialog --- .../ui/manager/sections/social/MessagingPreview.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/me/rhunk/snapenhance/ui/manager/sections/social/MessagingPreview.kt b/app/src/main/kotlin/me/rhunk/snapenhance/ui/manager/sections/social/MessagingPreview.kt index 60c546a9..8df28df7 100644 --- a/app/src/main/kotlin/me/rhunk/snapenhance/ui/manager/sections/social/MessagingPreview.kt +++ b/app/src/main/kotlin/me/rhunk/snapenhance/ui/manager/sections/social/MessagingPreview.kt @@ -294,11 +294,13 @@ class MessagingPreview( val hasSelection = selectedMessages.isNotEmpty() ActionButton(text = if (hasSelection) "Save selection" else "Save all", icon = Icons.Rounded.BookmarkAdded) { launchMessagingTask(MessagingTaskType.SAVE) - selectConstraintsDialog = true + if (hasSelection) runCurrentTask() + else selectConstraintsDialog = true } ActionButton(text = if (hasSelection) "Unsave selection" else "Unsave all", icon = Icons.Rounded.BookmarkBorder) { launchMessagingTask(MessagingTaskType.UNSAVE) - selectConstraintsDialog = true + if (hasSelection) runCurrentTask() + else selectConstraintsDialog = true } ActionButton(text = if (hasSelection) "Mark selected Snap as seen" else "Mark all Snaps as seen", icon = Icons.Rounded.RemoveRedEye) { launchMessagingTask(MessagingTaskType.READ, listOf( @@ -314,7 +316,8 @@ class MessagingPreview( messageSize = messages.size } } - selectConstraintsDialog = true + if (hasSelection) runCurrentTask() + else selectConstraintsDialog = true } } }