flotilla/src/app/components/AlertDelete.svelte

25 lines
683 B
Svelte
Raw Normal View History

2025-02-25 21:36:32 +00:00
<script lang="ts">
import Confirm from "@lib/components/Confirm.svelte"
import type {Alert} from "@app/state"
2025-06-27 21:36:09 +00:00
import {NOTIFIER_RELAY, NOTIFIER_PUBKEY} from "@app/state"
2025-02-25 21:36:32 +00:00
import {publishDelete} from "@app/commands"
import {pushToast} from "@app/toast"
type Props = {
alert: Alert
}
const {alert}: Props = $props()
const confirm = () => {
const relays = [NOTIFIER_RELAY]
const tags = [["p", NOTIFIER_PUBKEY]]
publishDelete({event: alert.event, relays, tags, protect: false})
2025-02-25 21:36:32 +00:00
pushToast({message: "Your alert has been deleted!"})
history.back()
}
</script>
<Confirm {confirm} message="You'll no longer receive messages for this alert." />