diff --git a/web/src/main.ts b/web/src/main.ts index a7cad80..85ae4c8 100644 --- a/web/src/main.ts +++ b/web/src/main.ts @@ -144,6 +144,8 @@ const loadAlerts = async () => { } const deleteAlert = async (alert: Alert) => { + if (!NOTIFIER_RELAY) return + if (confirm("Are you sure you want to delete this alert?")) { state.update(assoc('alertsLoading', true)) @@ -207,8 +209,11 @@ export const makeAlert = async ({freq, time, email, feeds, secret}: AlertParams) ) } -export const publishAlert = async (params: AlertParams) => - publish({event: await makeAlert(params), relays: [NOTIFIER_RELAY]}) +export const publishAlert = async (params: AlertParams) => { + if (!NOTIFIER_RELAY) return + + await publish({event: await makeAlert(params), relays: [NOTIFIER_RELAY]}) +} // Components