diff --git a/src/lib/components/messaging/ChatPreview.svelte b/src/lib/components/messaging/ChatPreview.svelte index c77402c4f..6f2c6a0e6 100644 --- a/src/lib/components/messaging/ChatPreview.svelte +++ b/src/lib/components/messaging/ChatPreview.svelte @@ -92,7 +92,7 @@ console.error("Error parsing JSON:", error, chat.last_message_preview) return "Invalid message format" } - const amountWei = parsedMessage.details.amount + const amountWei = parsedMessage.details?.amount if (sendingUserDetails.key !== ownId.key) { return `${sendingUserDetails.name} sent you ${amountWei}` } else { diff --git a/src/routes/chat/+page.svelte b/src/routes/chat/+page.svelte index 4366359b7..9c7e6c513 100644 --- a/src/routes/chat/+page.svelte +++ b/src/routes/chat/+page.svelte @@ -179,7 +179,7 @@ } const details = parsedMessage.details || {} - const amountWei = details.amount + const amountWei = details?.amount if (sender !== "") { return `${sender} sent you ${amountWei}`