diff options
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/FeedCard.tsx | 6 | ||||
-rw-r--r-- | src/components/ProfileCard.tsx | 12 | ||||
-rw-r--r-- | src/components/StarterPack/QrCodeDialog.tsx | 5 | ||||
-rw-r--r-- | src/components/StarterPack/ShareDialog.tsx | 3 | ||||
-rw-r--r-- | src/components/WhoCanReply.tsx | 1 | ||||
-rw-r--r-- | src/components/dms/ConvoMenu.tsx | 2 | ||||
-rw-r--r-- | src/components/dms/LeaveConvoPrompt.tsx | 2 | ||||
-rw-r--r-- | src/components/dms/MessageMenu.tsx | 2 | ||||
-rw-r--r-- | src/components/dms/MessagesNUX.tsx | 2 | ||||
-rw-r--r-- | src/components/dms/dialogs/NewChatDialog.tsx | 4 | ||||
-rw-r--r-- | src/components/dms/dialogs/ShareViaChatDialog.tsx | 7 | ||||
-rw-r--r-- | src/components/hooks/useFollowMethods.ts | 4 | ||||
-rw-r--r-- | src/components/moderation/LabelsOnMeDialog.tsx | 2 |
13 files changed, 32 insertions, 20 deletions
diff --git a/src/components/FeedCard.tsx b/src/components/FeedCard.tsx index 5e50f3c48..82d675a8e 100644 --- a/src/components/FeedCard.tsx +++ b/src/components/FeedCard.tsx @@ -264,9 +264,9 @@ function SaveButtonInner({ ]) } Toast.show(_(msg`Feeds updated!`)) - } catch (e: any) { - logger.error(e, {context: `FeedCard: failed to update feeds`, pin}) - Toast.show(_(msg`Failed to update feeds`)) + } catch (err: any) { + logger.error(err, {context: `FeedCard: failed to update feeds`, pin}) + Toast.show(_(msg`Failed to update feeds`), 'xmark') } }, [_, pin, saveFeeds, removeFeed, uri, savedFeedConfig, type], diff --git a/src/components/ProfileCard.tsx b/src/components/ProfileCard.tsx index 8bc9376e0..2d3b3240e 100644 --- a/src/components/ProfileCard.tsx +++ b/src/components/ProfileCard.tsx @@ -306,9 +306,9 @@ export function FollowButtonInner({ )}`, ), ) - } catch (e: any) { - if (e?.name !== 'AbortError') { - Toast.show(_(msg`An issue occurred, please try again.`)) + } catch (err: any) { + if (err?.name !== 'AbortError') { + Toast.show(_(msg`An issue occurred, please try again.`), 'xmark') } } } @@ -326,9 +326,9 @@ export function FollowButtonInner({ )}`, ), ) - } catch (e: any) { - if (e?.name !== 'AbortError') { - Toast.show(_(msg`An issue occurred, please try again.`)) + } catch (err: any) { + if (err?.name !== 'AbortError') { + Toast.show(_(msg`An issue occurred, please try again.`), 'xmark') } } } diff --git a/src/components/StarterPack/QrCodeDialog.tsx b/src/components/StarterPack/QrCodeDialog.tsx index 39eb3076d..a884390bf 100644 --- a/src/components/StarterPack/QrCodeDialog.tsx +++ b/src/components/StarterPack/QrCodeDialog.tsx @@ -67,7 +67,10 @@ export function QrCodeDialog({ try { await createAssetAsync(`file://${uri}`) } catch (e: unknown) { - Toast.show(_(msg`An error occurred while saving the QR code!`)) + Toast.show( + _(msg`An error occurred while saving the QR code!`), + 'xmark', + ) logger.error('Failed to save QR code', {error: e}) return } diff --git a/src/components/StarterPack/ShareDialog.tsx b/src/components/StarterPack/ShareDialog.tsx index 61e238081..9851b0856 100644 --- a/src/components/StarterPack/ShareDialog.tsx +++ b/src/components/StarterPack/ShareDialog.tsx @@ -66,6 +66,7 @@ function ShareDialogInner({ if (!res) { Toast.show( _(msg`You must grant access to your photo library to save the image.`), + 'xmark', ) return } @@ -75,7 +76,7 @@ function ShareDialogInner({ Toast.show(_(msg`Image saved to your camera roll!`)) control.close() } catch (e: unknown) { - Toast.show(_(msg`An error occurred while saving the QR code!`)) + Toast.show(_(msg`An error occurred while saving the QR code!`), 'xmark') logger.error('Failed to save QR code', {error: e}) return } diff --git a/src/components/WhoCanReply.tsx b/src/components/WhoCanReply.tsx index a73aae850..1ffb4da39 100644 --- a/src/components/WhoCanReply.tsx +++ b/src/components/WhoCanReply.tsx @@ -115,6 +115,7 @@ export function WhoCanReply({post, isThreadAuthor, style}: WhoCanReplyProps) { _( msg`There was an issue. Please check your internet connection and try again.`, ), + 'xmark', ) logger.error('Failed to edit threadgate', {message: err}) } diff --git a/src/components/dms/ConvoMenu.tsx b/src/components/dms/ConvoMenu.tsx index 3f680120b..a4fa625fa 100644 --- a/src/components/dms/ConvoMenu.tsx +++ b/src/components/dms/ConvoMenu.tsx @@ -85,7 +85,7 @@ let ConvoMenu = ({ } }, onError: () => { - Toast.show(_(msg`Could not mute chat`)) + Toast.show(_(msg`Could not mute chat`), 'xmark') }, }) diff --git a/src/components/dms/LeaveConvoPrompt.tsx b/src/components/dms/LeaveConvoPrompt.tsx index 7abc76f34..b0dd83b29 100644 --- a/src/components/dms/LeaveConvoPrompt.tsx +++ b/src/components/dms/LeaveConvoPrompt.tsx @@ -36,7 +36,7 @@ export function LeaveConvoPrompt({ } }, onError: () => { - Toast.show(_(msg`Could not leave chat`)) + Toast.show(_(msg`Could not leave chat`), 'xmark') }, }) diff --git a/src/components/dms/MessageMenu.tsx b/src/components/dms/MessageMenu.tsx index 92913d1cb..2978d2b22 100644 --- a/src/components/dms/MessageMenu.tsx +++ b/src/components/dms/MessageMenu.tsx @@ -54,7 +54,7 @@ export let MessageMenu = ({ ) Clipboard.setStringAsync(str) - Toast.show(_(msg`Copied to clipboard`)) + Toast.show(_(msg`Copied to clipboard`), 'clipboard-check') }, [_, message.text, message.facets]) const onPressTranslateMessage = React.useCallback(() => { diff --git a/src/components/dms/MessagesNUX.tsx b/src/components/dms/MessagesNUX.tsx index 8d3b11fac..9a3425243 100644 --- a/src/components/dms/MessagesNUX.tsx +++ b/src/components/dms/MessagesNUX.tsx @@ -57,7 +57,7 @@ function DialogInner({ const [initialized, setInitialzed] = React.useState(false) const {mutate: updateDeclaration} = useUpdateActorDeclaration({ onError: () => { - Toast.show(_(msg`Failed to update settings`)) + Toast.show(_(msg`Failed to update settings`), 'xmark') }, }) diff --git a/src/components/dms/dialogs/NewChatDialog.tsx b/src/components/dms/dialogs/NewChatDialog.tsx index 2b90fb02b..19f6eb6df 100644 --- a/src/components/dms/dialogs/NewChatDialog.tsx +++ b/src/components/dms/dialogs/NewChatDialog.tsx @@ -2,6 +2,7 @@ import React, {useCallback} from 'react' import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' +import {logger} from '#/logger' import {useGetConvoForMembers} from '#/state/queries/messages/get-convo-for-members' import {logEvent} from 'lib/statsig/statsig' import {FAB} from '#/view/com/util/fab/FAB' @@ -31,7 +32,8 @@ export function NewChat({ logEvent('chat:open', {logContext: 'NewChatDialog'}) }, onError: error => { - Toast.show(error.message) + logger.error('Failed to create chat', {safeMessage: error}) + Toast.show(_(msg`An issue occurred starting the chat`), 'xmark') }, }) diff --git a/src/components/dms/dialogs/ShareViaChatDialog.tsx b/src/components/dms/dialogs/ShareViaChatDialog.tsx index d2fefd33b..01906a430 100644 --- a/src/components/dms/dialogs/ShareViaChatDialog.tsx +++ b/src/components/dms/dialogs/ShareViaChatDialog.tsx @@ -2,6 +2,7 @@ import React, {useCallback} from 'react' import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' +import {logger} from '#/logger' import {useGetConvoForMembers} from '#/state/queries/messages/get-convo-for-members' import {logEvent} from 'lib/statsig/statsig' import * as Toast from '#/view/com/util/Toast' @@ -43,7 +44,11 @@ function SendViaChatDialogInner({ logEvent('chat:open', {logContext: 'SendViaChatDialog'}) }, onError: error => { - Toast.show(error.message) + logger.error('Failed to share post to chat', {message: error}) + Toast.show( + _(msg`An issue occurred while trying to open the chat`), + 'xmark', + ) }, }) diff --git a/src/components/hooks/useFollowMethods.ts b/src/components/hooks/useFollowMethods.ts index 1e91a1f38..d67c3690f 100644 --- a/src/components/hooks/useFollowMethods.ts +++ b/src/components/hooks/useFollowMethods.ts @@ -32,7 +32,7 @@ export function useFollowMethods({ } catch (e: any) { logger.error(`useFollowMethods: failed to follow`, {message: String(e)}) if (e?.name !== 'AbortError') { - Toast.show(_(msg`An issue occurred, please try again.`)) + Toast.show(_(msg`An issue occurred, please try again.`), 'xmark') } } }) @@ -47,7 +47,7 @@ export function useFollowMethods({ message: String(e), }) if (e?.name !== 'AbortError') { - Toast.show(_(msg`An issue occurred, please try again.`)) + Toast.show(_(msg`An issue occurred, please try again.`), 'xmark') } } }) diff --git a/src/components/moderation/LabelsOnMeDialog.tsx b/src/components/moderation/LabelsOnMeDialog.tsx index c226fbbf7..e581d22c1 100644 --- a/src/components/moderation/LabelsOnMeDialog.tsx +++ b/src/components/moderation/LabelsOnMeDialog.tsx @@ -241,7 +241,7 @@ function AppealForm({ }, onError: err => { logger.error('Failed to submit label appeal', {message: err}) - Toast.show(_(msg`Failed to submit appeal, please try again.`)) + Toast.show(_(msg`Failed to submit appeal, please try again.`), 'xmark') }, onSuccess: () => { control.close() |