mirror of
https://github.com/coracle-social/flotilla.git
synced 2025-12-10 19:07:06 +00:00
Fix alerts
This commit is contained in:
@@ -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.
|
- 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.
|
- 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)
|
- "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.
|
`app/core/requests` contains utilities related to loading data from the nostr network. This might include feed manager utilities, loaders, or listeners.
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
url?: string
|
url?: string
|
||||||
room?: string
|
channel?: string
|
||||||
notifyChat?: boolean
|
notifyChat?: boolean
|
||||||
notifyThreads?: boolean
|
notifyThreads?: boolean
|
||||||
notifyCalendar?: boolean
|
notifyCalendar?: boolean
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
let {
|
let {
|
||||||
url = "",
|
url = "",
|
||||||
room = "email",
|
channel = "email",
|
||||||
notifyChat = true,
|
notifyChat = true,
|
||||||
notifyThreads = true,
|
notifyThreads = true,
|
||||||
notifyCalendar = true,
|
notifyCalendar = true,
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
const back = () => history.back()
|
const back = () => history.back()
|
||||||
|
|
||||||
const submit = async () => {
|
const submit = async () => {
|
||||||
if (room === "email" && !email.includes("@")) {
|
if (channel === "email" && !email.includes("@")) {
|
||||||
return pushToast({
|
return pushToast({
|
||||||
theme: "error",
|
theme: "error",
|
||||||
message: "Please provide an email address",
|
message: "Please provide an email address",
|
||||||
@@ -100,7 +100,7 @@
|
|||||||
feed: makeIntersectionFeed(feedFromFilters(filters), makeRelayFeed(url)),
|
feed: makeIntersectionFeed(feedFromFilters(filters), makeRelayFeed(url)),
|
||||||
claims: claim ? {[url]: claim} : {},
|
claims: claim ? {[url]: claim} : {},
|
||||||
description: `for ${displayList(display)} on ${displayRelayUrl(url)}`,
|
description: `for ${displayList(display)} on ${displayRelayUrl(url)}`,
|
||||||
email: room === "email" ? {cron, email} : undefined,
|
email: channel === "email" ? {cron, email} : undefined,
|
||||||
})
|
})
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
if (!canSendPushNotifications()) {
|
if (!canSendPushNotifications()) {
|
||||||
room = "email"
|
channel = "email"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
@@ -136,14 +136,14 @@
|
|||||||
<p>Alert Type*</p>
|
<p>Alert Type*</p>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
{#snippet input()}
|
{#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="email">Email Digest</option>
|
||||||
<option value="push">Push Notification</option>
|
<option value="push">Push Notification</option>
|
||||||
</select>
|
</select>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</FieldInline>
|
</FieldInline>
|
||||||
{/if}
|
{/if}
|
||||||
{#if room === "email"}
|
{#if channel === "email"}
|
||||||
<FieldInline>
|
<FieldInline>
|
||||||
{#snippet label()}
|
{#snippet label()}
|
||||||
<p>Email Address*</p>
|
<p>Email Address*</p>
|
||||||
|
|||||||
@@ -24,11 +24,11 @@
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
url?: string
|
url?: string
|
||||||
room?: string
|
channel?: string
|
||||||
hideSpaceField?: boolean
|
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)
|
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) => {
|
const uncheckDmAlert = async (message: string) => {
|
||||||
await sleep(100)
|
await sleep(100)
|
||||||
|
|||||||
@@ -98,7 +98,7 @@
|
|||||||
|
|
||||||
const manageAlerts = () => {
|
const manageAlerts = () => {
|
||||||
const component = hasAlerts ? Alerts : AlertAdd
|
const component = hasAlerts ? Alerts : AlertAdd
|
||||||
const params = {url, room: "push", hideSpaceField: true}
|
const params = {url, channel: "push", hideSpaceField: true}
|
||||||
|
|
||||||
pushModal(component, params, {replaceState})
|
pushModal(component, params, {replaceState})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user