diff options
author | Minseo Lee <itoupluk427@gmail.com> | 2025-03-07 02:46:09 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-06 11:46:09 -0600 |
commit | a7db0bac6fa42a47f05b9ef5fabc05656a347f08 (patch) | |
tree | b44c29f5fb428f6aa353984fc5c930547ec85e16 /src/view/com/util/forms | |
parent | 29eef6188ae4c00006ae759e1b3815b8bd091a87 (diff) | |
download | voidsky-a7db0bac6fa42a47f05b9ef5fabc05656a347f08.tar.zst |
Add context for toast messages (#7902)
* add context for toast * add
Diffstat (limited to 'src/view/com/util/forms')
-rw-r--r-- | src/view/com/util/forms/PostDropdownBtnMenuItems.tsx | 22 |
1 files changed, 13 insertions, 9 deletions
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}) |