Initialize thunk status

This commit is contained in:
Jon Staab
2025-04-02 16:20:29 -07:00
parent 357bcd4366
commit 847d2cb94d
+9 -1
View File
@@ -1,5 +1,5 @@
import {Writable, Readable, writable, derived, get} from "svelte/store" 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 {stamp, own, hash} from "@welshman/signer"
import { import {
TrustedEvent, TrustedEvent,
@@ -222,6 +222,14 @@ export const thunkQueue = new TaskQueue<Thunk>({
return 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 // Send it off
const pub = new MultiPublish({ const pub = new MultiPublish({
event: signedEvent, event: signedEvent,