From 847d2cb94d70b71afdc368ca03419b6ff7d38a5a Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Wed, 2 Apr 2025 16:20:29 -0700 Subject: [PATCH] Initialize thunk status --- packages/app/src/thunk.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/app/src/thunk.ts b/packages/app/src/thunk.ts index 8a7feb0..bfe7ab5 100644 --- a/packages/app/src/thunk.ts +++ b/packages/app/src/thunk.ts @@ -1,5 +1,5 @@ import {Writable, Readable, writable, derived, get} from "svelte/store" -import {Deferred, TaskQueue, dissoc, identity, uniq, defer, sleep, assoc} from "@welshman/lib" +import {Deferred, fromPairs, TaskQueue, dissoc, identity, uniq, defer, sleep, assoc} from "@welshman/lib" import {stamp, own, hash} from "@welshman/signer" import { TrustedEvent, @@ -222,6 +222,14 @@ export const thunkQueue = new TaskQueue({ return } + // Update status to pending + thunk.status.set( + fromPairs( + thunk.request.relays + .map(url => [url, {status: PublishStatus.Pending, message: "Sending your message..."}]) + ) + ) + // Send it off const pub = new MultiPublish({ event: signedEvent,