diff --git a/frontend/app/src/components/home/ChatMessage.svelte b/frontend/app/src/components/home/ChatMessage.svelte index 12aad6bafe..32b8b266ca 100644 --- a/frontend/app/src/components/home/ChatMessage.svelte +++ b/frontend/app/src/components/home/ChatMessage.svelte @@ -136,7 +136,6 @@ $: communityMembers = client.currentCommunityMembers; $: senderDisplayName = client.getDisplayName(sender, $communityMembers); $: messageContext = { chatId, threadRootMessageIndex }; - $: lastCryptoSent = client.lastCryptoSent; $: tips = msg.tips ? Object.entries(msg.tips) : []; afterUpdate(() => { @@ -356,9 +355,7 @@ const transfer = ev.detail; const currentTip = (msg.tips[transfer.ledger] ?? {})[client.user.userId] ?? 0n; client.tipMessage(messageContext, msg.messageId, transfer, currentTip).then((resp) => { - if (resp.kind === "success") { - lastCryptoSent.set(transfer.ledger); - } else { + if (resp.kind !== "success") { toastStore.showFailureToast("tip.failure"); } }); diff --git a/frontend/app/src/components/home/TipBuilder.svelte b/frontend/app/src/components/home/TipBuilder.svelte index 7c373504a0..a2ecd72c2d 100644 --- a/frontend/app/src/components/home/TipBuilder.svelte +++ b/frontend/app/src/components/home/TipBuilder.svelte @@ -36,6 +36,7 @@ let dollarScale = tweened(0); let centAmount = 0; + $: lastCryptoSent = client.lastCryptoSent; $: cryptoBalanceStore = client.cryptoBalance; $: cryptoLookup = client.cryptoLookup; $: cryptoBalance = $cryptoBalanceStore[ledger] ?? BigInt(0); @@ -84,6 +85,7 @@ createdAtNanos: BigInt(Date.now()) * BigInt(1_000_000), }; dispatch("send", transfer); + lastCryptoSent.set(ledger); } function cancel() {