commit 4b926f199c9af38227a5e2123774b8d5b020b766
parent ff79f2009d7ac6ccde0c28dc9af48fb9fd050f70
Author: rhunk <101876869+rhunk@users.noreply.github.com>
Date:   Sat, 11 Nov 2023 23:43:15 +0100

fix(app/messaging_preview): constraints dialog

Diffstat:
Mapp/src/main/kotlin/me/rhunk/snapenhance/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 @@ -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 } } }