Fix alerts

This commit is contained in:
Jon Staab
2025-10-31 14:51:59 -07:00
parent bef04fa899
commit ba2b5d182e
4 changed files with 12 additions and 12 deletions

View File

@@ -69,7 +69,7 @@ Here are a few important domain objects:
- Spaces are relays used as community groups. Their `url`s are core to a lot of data and components, and are frequently passed around from place to place.
- Chats are direct message conversations. There is currently some ambiguity in routing, since relays that don't support NIP 29 also have a "chat" tab, which uses vanilla NIP-C7.
- NIP 29 groups are variously called "rooms" and "rooms". Conventionally, a "room" is a group id, while a "room" as an object representing the group's metadata.
- NIP 29 groups are called "rooms". Conventionally, "h" is a group id, while a "room" as an object representing the group's metadata.
- "Alerts" are records of requests the user has made to be notified, following [this NIP](https://github.com/nostr-protocol/nips/pull/1796)
`app/core/requests` contains utilities related to loading data from the nostr network. This might include feed manager utilities, loaders, or listeners.

View File

@@ -21,7 +21,7 @@
type Props = {
url?: string
room?: string
channel?: string
notifyChat?: boolean
notifyThreads?: boolean
notifyCalendar?: boolean
@@ -30,7 +30,7 @@
let {
url = "",
room = "email",
channel = "email",
notifyChat = true,
notifyThreads = true,
notifyCalendar = true,
@@ -50,7 +50,7 @@
const back = () => history.back()
const submit = async () => {
if (room === "email" && !email.includes("@")) {
if (channel === "email" && !email.includes("@")) {
return pushToast({
theme: "error",
message: "Please provide an email address",
@@ -100,7 +100,7 @@
feed: makeIntersectionFeed(feedFromFilters(filters), makeRelayFeed(url)),
claims: claim ? {[url]: claim} : {},
description: `for ${displayList(display)} on ${displayRelayUrl(url)}`,
email: room === "email" ? {cron, email} : undefined,
email: channel === "email" ? {cron, email} : undefined,
})
if (error) {
@@ -116,7 +116,7 @@
onMount(() => {
if (!canSendPushNotifications()) {
room = "email"
channel = "email"
}
})
</script>
@@ -136,14 +136,14 @@
<p>Alert Type*</p>
{/snippet}
{#snippet input()}
<select bind:value={room} class="select select-bordered">
<select bind:value={channel} class="select select-bordered">
<option value="email">Email Digest</option>
<option value="push">Push Notification</option>
</select>
{/snippet}
</FieldInline>
{/if}
{#if room === "email"}
{#if channel === "email"}
<FieldInline>
{#snippet label()}
<p>Email Address*</p>

View File

@@ -24,11 +24,11 @@
type Props = {
url?: string
room?: string
channel?: string
hideSpaceField?: boolean
}
const {url = "", room = "push", hideSpaceField = false}: Props = $props()
const {url = "", channel = "push", hideSpaceField = false}: Props = $props()
const dmStatus = $derived($dmAlert ? deriveAlertStatus(getAddress($dmAlert.event)) : undefined)
@@ -46,7 +46,7 @@
}),
)
const startAlert = () => pushModal(AlertAdd, {url, room, hideSpaceField})
const startAlert = () => pushModal(AlertAdd, {url, channel, hideSpaceField})
const uncheckDmAlert = async (message: string) => {
await sleep(100)

View File

@@ -98,7 +98,7 @@
const manageAlerts = () => {
const component = hasAlerts ? Alerts : AlertAdd
const params = {url, room: "push", hideSpaceField: true}
const params = {url, channel: "push", hideSpaceField: true}
pushModal(component, params, {replaceState})
}