forked from coracle/flotilla
Update notification subscriptions reactively
This commit is contained in:
+12
-13
@@ -338,19 +338,7 @@ export const relaysMostlyRestricted = writable<Record<string, string>>({})
|
||||
// Push notifications
|
||||
|
||||
export const notificationSettings = withGetter(
|
||||
writable<{
|
||||
push: boolean
|
||||
sound: boolean
|
||||
badge: boolean
|
||||
spaces: boolean
|
||||
mentions: boolean
|
||||
messages: boolean
|
||||
token?: string
|
||||
subscription?: {
|
||||
key: string
|
||||
callback: string
|
||||
}
|
||||
}>({
|
||||
writable({
|
||||
push: false,
|
||||
sound: false,
|
||||
badge: false,
|
||||
@@ -360,6 +348,17 @@ export const notificationSettings = withGetter(
|
||||
}),
|
||||
)
|
||||
|
||||
export const notificationState = withGetter(
|
||||
writable<{
|
||||
token?: string
|
||||
subscription?: {
|
||||
key: string
|
||||
callback: string
|
||||
}
|
||||
}>({}),
|
||||
)
|
||||
|
||||
|
||||
// Chats
|
||||
|
||||
export type Chat = {
|
||||
|
||||
Reference in New Issue
Block a user