From a7db0bac6fa42a47f05b9ef5fabc05656a347f08 Mon Sep 17 00:00:00 2001
From: Minseo Lee <itoupluk427@gmail.com>
Date: Fri, 7 Mar 2025 02:46:09 +0900
Subject: Add context for toast messages (#7902)

* add context for toast

* add
---
 .../com/util/forms/PostDropdownBtnMenuItems.tsx    | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

(limited to 'src/view/com/util/forms/PostDropdownBtnMenuItems.tsx')

diff --git a/src/view/com/util/forms/PostDropdownBtnMenuItems.tsx b/src/view/com/util/forms/PostDropdownBtnMenuItems.tsx
index c8ddf0f20..59077dd64 100644
--- a/src/view/com/util/forms/PostDropdownBtnMenuItems.tsx
+++ b/src/view/com/util/forms/PostDropdownBtnMenuItems.tsx
@@ -183,7 +183,7 @@ let PostDropdownMenuItems = ({
   const onDeletePost = React.useCallback(() => {
     deletePostMutate({uri: postUri}).then(
       () => {
-        Toast.show(_(msg`Post deleted`))
+        Toast.show(_(msg({message: 'Post deleted', context: 'toast'})))
 
         const route = getCurrentRoute(navigation.getState())
         if (route.name === 'PostThread') {
@@ -274,7 +274,7 @@ let PostDropdownMenuItems = ({
       item: postUri,
       feedContext: postFeedContext,
     })
-    Toast.show(_(msg`Feedback sent!`))
+    Toast.show(_(msg({message: 'Feedback sent!', context: 'toast'})))
   }, [feedFeedback, postUri, postFeedContext, _])
 
   const onPressShowLess = React.useCallback(() => {
@@ -283,7 +283,7 @@ let PostDropdownMenuItems = ({
       item: postUri,
       feedContext: postFeedContext,
     })
-    Toast.show(_(msg`Feedback sent!`))
+    Toast.show(_(msg({message: 'Feedback sent!', context: 'toast'})))
   }, [feedFeedback, postUri, postFeedContext, _])
 
   const onSelectChatToShareTo = React.useCallback(
@@ -314,7 +314,9 @@ let PostDropdownMenuItems = ({
           : _(msg`Quote post was re-attached`),
       )
     } catch (e: any) {
-      Toast.show(_(msg`Updating quote attachment failed`))
+      Toast.show(
+        _(msg({message: 'Updating quote attachment failed', context: 'toast'})),
+      )
       logger.error(`Failed to ${action} quote`, {safeMessage: e.message})
     }
   }, [_, quoteEmbed, post, toggleQuoteDetachment])
@@ -341,10 +343,12 @@ let PostDropdownMenuItems = ({
       Toast.show(
         isHide
           ? _(msg`Reply was successfully hidden`)
-          : _(msg`Reply visibility updated`),
+          : _(msg({message: 'Reply visibility updated', context: 'toast'})),
       )
     } catch (e: any) {
-      Toast.show(_(msg`Updating reply visibility failed`))
+      Toast.show(
+        _(msg({message: 'Updating reply visibility failed', context: 'toast'})),
+      )
       logger.error(`Failed to ${action} reply`, {safeMessage: e.message})
     }
   }, [
@@ -368,7 +372,7 @@ let PostDropdownMenuItems = ({
   const onBlockAuthor = useCallback(async () => {
     try {
       await queueBlock()
-      Toast.show(_(msg`Account blocked`))
+      Toast.show(_(msg({message: 'Account blocked', context: 'toast'})))
     } catch (e: any) {
       if (e?.name !== 'AbortError') {
         logger.error('Failed to block account', {message: e})
@@ -381,7 +385,7 @@ let PostDropdownMenuItems = ({
     if (postAuthor.viewer?.muted) {
       try {
         await queueUnmute()
-        Toast.show(_(msg`Account unmuted`))
+        Toast.show(_(msg({message: 'Account unmuted', context: 'toast'})))
       } catch (e: any) {
         if (e?.name !== 'AbortError') {
           logger.error('Failed to unmute account', {message: e})
@@ -391,7 +395,7 @@ let PostDropdownMenuItems = ({
     } else {
       try {
         await queueMute()
-        Toast.show(_(msg`Account muted`))
+        Toast.show(_(msg({message: 'Account muted', context: 'toast'})))
       } catch (e: any) {
         if (e?.name !== 'AbortError') {
           logger.error('Failed to mute account', {message: e})
-- 
cgit 1.4.1

