From 92e62087e4cbc731204aa40d5dcde905d4409e12 Mon Sep 17 00:00:00 2001 From: Wooyeol Lee Date: Tue, 5 Dec 2023 17:21:24 +0900 Subject: [PATCH] fix: toast appears before confirm dialog --- .../com/goliath/emojihub/views/components/PlayEmojiView.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/app/src/main/java/com/goliath/emojihub/views/components/PlayEmojiView.kt b/android/app/src/main/java/com/goliath/emojihub/views/components/PlayEmojiView.kt index 6b993e94..07668eb0 100644 --- a/android/app/src/main/java/com/goliath/emojihub/views/components/PlayEmojiView.kt +++ b/android/app/src/main/java/com/goliath/emojihub/views/components/PlayEmojiView.kt @@ -120,7 +120,6 @@ fun PlayEmojiView( } else { if (isSaved) { showUnSaveDialog = true - Toast.makeText(context, "Emoji unsaved!", Toast.LENGTH_SHORT).show() } else { emojiViewModel.saveEmoji(currentEmoji.id) isSaved = true @@ -178,7 +177,8 @@ fun PlayEmojiView( emojiViewModel.unSaveEmoji(currentEmoji.id) isSaved = false savedCount-- - showUnSaveDialog = false }, + showUnSaveDialog = false + Toast.makeText(context, "Emoji unsaved!", Toast.LENGTH_SHORT).show() }, dismiss = { showUnSaveDialog = false } ) }