Await deletions
Some checks are pending
CI / lint-check-build (push) Waiting to run

This commit is contained in:
Jon Staab 2026-08-22 12:36:25 -07:00
parent 35ed7bc09f
commit 637be41a8b

View file

@ -3,6 +3,7 @@
import Confirm from "@lib/components/Confirm.svelte" import Confirm from "@lib/components/Confirm.svelte"
import {deletes, relays} from "@app/core" import {deletes, relays} from "@app/core"
import {clearModals} from "@app/modal" import {clearModals} from "@app/modal"
import {pushToast} from "@app/toast"
type Props = { type Props = {
url: string url: string
@ -16,8 +17,11 @@
const confirm = async () => { const confirm = async () => {
const protect = await shouldProtect const protect = await shouldProtect
const command = await $deletes.deleteEvent(event, writer => writer.setProtected(protect)) const command = await $deletes.deleteEvent(event, writer => writer.setProtected(protect))
const error = await command.publishToRelays([url]).waitForError()
command.publishToRelays([url]) if (error) {
return pushToast({theme: "error", message: error})
}
clearModals() clearModals()
} }