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() {
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 }[] = [];