diff --git a/src/pages/create/index.tsx b/src/pages/create/index.tsx index f0c1f0c..63140bf 100644 --- a/src/pages/create/index.tsx +++ b/src/pages/create/index.tsx @@ -868,11 +868,11 @@ export const CreatePage = () => { setLoadingSpinnerDesc('Updating user app data') - const metaUrl = await uploadMetaToFileStorage(meta, encryptionKey) - const event = await updateUsersAppData(meta) if (!event) return + const metaUrl = await uploadMetaToFileStorage(meta, encryptionKey) + setLoadingSpinnerDesc('Sending notifications to counterparties') const promises = sendNotifications({ metaUrl, diff --git a/src/pages/sign/index.tsx b/src/pages/sign/index.tsx index 346e226..01d5738 100644 --- a/src/pages/sign/index.tsx +++ b/src/pages/sign/index.tsx @@ -753,7 +753,17 @@ export const SignPage = () => { return } - const metaUrl = await uploadMetaToFileStorage(meta, encryptionKey) + let metaUrl: string | undefined + try { + metaUrl = await uploadMetaToFileStorage(meta, encryptionKey) + } catch (error) { + if (error instanceof Error) { + toast.error(error.message) + } + console.error(error) + setIsLoading(false) + return + } const userSet = new Set<`npub1${string}`>() if (submittedBy && submittedBy !== usersPubkey) { diff --git a/src/utils/nostr.ts b/src/utils/nostr.ts index ed51fac..0ed4054 100644 --- a/src/utils/nostr.ts +++ b/src/utils/nostr.ts @@ -949,8 +949,12 @@ const processReceivedEvent = async (event: Event, difficulty: number = 5) => { encryptionKey = decrypted } - - meta = await fetchMetaFromFileStorage(notification.metaUrl, encryptionKey) + try { + meta = await fetchMetaFromFileStorage(notification.metaUrl, encryptionKey) + } catch (error) { + console.error(`An error occured fetching meta file from storage`, error) + return + } } else { meta = parsedContent }