problem: purchase toast does not show upon new zap recieved

This commit is contained in:
gsovereignty
2024-08-18 17:36:47 +08:00
parent f6fb0602f4
commit 6892790d33

View File

@@ -36,6 +36,7 @@
} }
function checkNewZaps() { function checkNewZaps() {
console.log(39);
const currentTime = Date.now() / 1000; const currentTime = Date.now() / 1000;
const recentZaps = Array.from(unratifiedZaps.values()).filter( const recentZaps = Array.from(unratifiedZaps.values()).filter(
(zap) => (zap) =>
@@ -50,11 +51,6 @@
lastCheckTime = currentTime; lastCheckTime = currentTime;
} }
$: {
if (unratifiedZaps.size > 0) {
checkNewZaps();
}
}
onMount(() => { onMount(() => {
lastCheckTime = Date.now() / 1000 - 30; // 30 seconds ago lastCheckTime = Date.now() / 1000 - 30; // 30 seconds ago
@@ -71,6 +67,7 @@
for (let [_, a] of unratifiedZaps) { for (let [_, a] of unratifiedZaps) {
unratifiedZapsAmount += a.Amount / 1000; unratifiedZapsAmount += a.Amount / 1000;
} }
checkNewZaps();
unratifiedZapsAmount = unratifiedZapsAmount; unratifiedZapsAmount = unratifiedZapsAmount;
} }
let _merits: { pubkey: string; merits: number; sats: number }[] = []; let _merits: { pubkey: string; merits: number; sats: number }[] = [];