From 6892790d33f26cc26840e8b5d40c3ad5e8bb8bb1 Mon Sep 17 00:00:00 2001 From: gsovereignty Date: Sun, 18 Aug 2024 17:36:47 +0800 Subject: [PATCH] problem: purchase toast does not show upon new zap recieved --- src/components/MeritsAndSatflow.svelte | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/MeritsAndSatflow.svelte b/src/components/MeritsAndSatflow.svelte index 37fcc1f..e97187c 100644 --- a/src/components/MeritsAndSatflow.svelte +++ b/src/components/MeritsAndSatflow.svelte @@ -36,6 +36,7 @@ } function checkNewZaps() { + console.log(39); const currentTime = Date.now() / 1000; const recentZaps = Array.from(unratifiedZaps.values()).filter( (zap) => @@ -50,11 +51,6 @@ lastCheckTime = currentTime; } - $: { - if (unratifiedZaps.size > 0) { - checkNewZaps(); - } - } onMount(() => { lastCheckTime = Date.now() / 1000 - 30; // 30 seconds ago @@ -71,6 +67,7 @@ for (let [_, a] of unratifiedZaps) { unratifiedZapsAmount += a.Amount / 1000; } + checkNewZaps(); unratifiedZapsAmount = unratifiedZapsAmount; } let _merits: { pubkey: string; merits: number; sats: number }[] = [];