forked from coracle/flotilla
Add fcm push notifications
This commit is contained in:
@@ -63,6 +63,7 @@
|
||||
} from "@app/state"
|
||||
import {loadUserData, listenForNotifications} from "@app/requests"
|
||||
import {theme} from "@app/theme"
|
||||
import {initializePushNotifications} from "@app/push"
|
||||
import * as commands from "@app/commands"
|
||||
import * as requests from "@app/requests"
|
||||
import * as notifications from "@app/notifications"
|
||||
@@ -73,6 +74,9 @@
|
||||
dropSession($session.pubkey)
|
||||
}
|
||||
|
||||
// Initialize push notification handler asap
|
||||
initializePushNotifications()
|
||||
|
||||
const {children} = $props()
|
||||
|
||||
const ready = $state(defer<void>())
|
||||
@@ -95,8 +99,8 @@
|
||||
})
|
||||
|
||||
// Listen for navigation messages from service worker
|
||||
navigator.serviceWorker?.addEventListener('message', (event) => {
|
||||
if (event.data && event.data.type === 'NAVIGATE') {
|
||||
navigator.serviceWorker?.addEventListener("message", event => {
|
||||
if (event.data && event.data.type === "NAVIGATE") {
|
||||
goto(event.data.url)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import {onMount} from "svelte"
|
||||
import * as nip19 from "nostr-tools/nip19"
|
||||
import type {TrustedEvent} from "@welshman/util"
|
||||
import {Address, getIdFilters, getTagValue} from "@welshman/util"
|
||||
import {Address, getIdFilters} from "@welshman/util"
|
||||
import {LOCAL_RELAY_URL} from "@welshman/relay"
|
||||
import {load} from "@welshman/net"
|
||||
import {page} from "$app/stores"
|
||||
|
||||
Reference in New Issue
Block a user