Skip to content

Commit

Permalink
handle embedded in messages
Browse files Browse the repository at this point in the history
  • Loading branch information
futurepaul committed Apr 12, 2024
1 parent 9140efa commit 73a0f19
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/routes/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -223,6 +227,11 @@ function SingleMessage(props: {
</Match>
<Match when={parsed()?.type === "cashu"}>
<div class="flex flex-col gap-2">
<Show when={parsed()?.message_without_invoice}>
<p class="!mb-0 break-words">
{parsed()?.message_without_invoice}
</p>
</Show>
<div class="flex items-center gap-2">
<Zap class="h-4 w-4" />
<span>Cashu Token</span>
Expand Down

0 comments on commit 73a0f19

Please sign in to comment.