From 21dfa1f0697f5f2274bb513baccc811e43b946e2 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Fri, 12 Apr 2024 17:02:12 -0500 Subject: [PATCH] handle embedded in messages --- src/routes/Chat.tsx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/routes/Chat.tsx b/src/routes/Chat.tsx index 3cd7c663..2808bb20 100644 --- a/src/routes/Chat.tsx +++ b/src/routes/Chat.tsx @@ -131,6 +131,10 @@ function SingleMessage(props: { if (result.value?.cashu_token) { return { type: "cashu", + message_without_invoice: props.dm.message.replace( + result.value.original, + "" + ), from: props.dm.from, value: result.value.cashu_token, amount: result.value.amount_sats @@ -168,9 +172,9 @@ function SingleMessage(props: { ); } - function handleRedeem() { + function handleRedeem(token: string) { actions.handleIncomingString( - props.dm.message, + token, (error) => { showToast(error); }, @@ -223,6 +227,11 @@ function SingleMessage(props: {
+ +

+ {parsed()?.message_without_invoice} +

+
Cashu Token @@ -237,7 +246,9 @@ function SingleMessage(props: {