diff --git a/src/components/Emojis/List.tsx b/src/components/Emojis/List.tsx index 455a1044..56418778 100644 --- a/src/components/Emojis/List.tsx +++ b/src/components/Emojis/List.tsx @@ -131,7 +131,7 @@ const EmojisList = () => { > {uri.preview && !imageLoaded ? ( ) : null} { setImageLoaded(true) diff --git a/src/components/Instance/index.tsx b/src/components/Instance/index.tsx index 5aad3b7b..efe90d19 100644 --- a/src/components/Instance/index.tsx +++ b/src/components/Instance/index.tsx @@ -186,7 +186,7 @@ const ComponentInstance: React.FC = ({ if (!account) { setGlobalStorage('accounts', (accounts || []).concat([accountKey])) } - setAccount(accountKey) + await setAccount(accountKey) goBack && navigation.goBack() } diff --git a/src/screens/Compose/Root/Footer/Attachments.tsx b/src/screens/Compose/Root/Footer/Attachments.tsx index 7743ce1d..b4496616 100644 --- a/src/screens/Compose/Root/Footer/Attachments.tsx +++ b/src/screens/Compose/Root/Footer/Attachments.tsx @@ -106,7 +106,7 @@ const ComposeAttachments: React.FC = ({ accessibleRefAttachments }) => { > (key: T) => { const value = storage.global.getString(key) if (value?.length) { - return JSON.parse(value) as NonNullable extends object - ? StorageGlobal[T] - : never + try { + return JSON.parse(value) as NonNullable extends object + ? StorageGlobal[T] + : never + } catch { + return undefined + } } else { return undefined } @@ -108,9 +112,13 @@ export const getAccountStorage = { object: (key: T) => { const value = storage.account?.getString(key) if (value?.length) { - return JSON.parse(value) as NonNullable extends object - ? StorageAccount[T] - : never + try { + return JSON.parse(value) as NonNullable extends object + ? StorageAccount[T] + : never + } catch { + return undefined + } } else { return undefined }