diff --git a/src/util/misc.ts b/src/util/misc.ts index 1d6e4c4b..c5fbdc28 100644 --- a/src/util/misc.ts +++ b/src/util/misc.ts @@ -226,7 +226,7 @@ export const shuffle = sortBy(() => Math.random() > 0.5) export const batch = (t, f) => { const xs = [] - const cb = throttle(t, () => f(xs.splice(0))) + const cb = throttle(t, () => xs.length > 0 && f(xs.splice(0))) return x => { xs.push(x) diff --git a/src/views/notes/Note.svelte b/src/views/notes/Note.svelte index 02238ee4..2ea45913 100644 --- a/src/views/notes/Note.svelte +++ b/src/views/notes/Note.svelte @@ -241,6 +241,7 @@ invoice: null, loading: false, startedAt: now(), + confirmed: false, } } @@ -282,7 +283,10 @@ }, onChunk: chunk => { note.zaps = note.zaps.concat(chunk) - cleanupZap() + + zap.confirmed = true + + setTimeout(cleanupZap, 1000) }, }) } @@ -575,10 +579,19 @@

Send a zap

to {displayPerson($person)}

- {#if zap.invoice} + {#if zap.confirmed} +
+ +

Success! Zap confirmed.

+
+ {:else if zap.invoice} -
+

Copy or scan using a lightning wallet to pay your zap. +

+
+ + Waiting for confirmation...
{:else}