diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2025-11-08 16:28:10 -0500 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2025-11-08 16:28:10 -0500 |
| commit | fc6914831743f6d683c59adb367479defe6f8b3a (patch) | |
| tree | 5b997adac55f47b52f30022013b8ec3b2c10bcc5 /ui/routes/(app)/me/+page.svelte | |
| parent | 0ef69c7d256380e660edc45ace7f1d6151226340 (diff) | |
| parent | 6bab5b4405c9adafb2ce76540595a62eea80acc0 (diff) | |
Integrate the prototype push notification support.
We're going to move forwards with this for now, as low-utility as it is, so that we can more easily iterate on it in a real-world environment (hi.grimoire.ca).
Diffstat (limited to 'ui/routes/(app)/me/+page.svelte')
| -rw-r--r-- | ui/routes/(app)/me/+page.svelte | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ui/routes/(app)/me/+page.svelte b/ui/routes/(app)/me/+page.svelte index 0c960c8..a21d160 100644 --- a/ui/routes/(app)/me/+page.svelte +++ b/ui/routes/(app)/me/+page.svelte @@ -2,10 +2,16 @@ import LogOut from '$lib/components/LogOut.svelte'; import Invites from '$lib/components/Invites.svelte'; import ChangePassword from '$lib/components/ChangePassword.svelte'; + import PushSubscription from '$lib/components/PushSubscription.svelte'; import { goto } from '$app/navigation'; import * as api from '$lib/apiServer.js'; + const { data } = $props(); + const { session } = data; + const subscription = $derived(session.push.subscription); + const vapid = $derived(session.push.vapidKey); + let invites = $state([]); async function logOut() { @@ -25,10 +31,20 @@ invites.push(response.data); } } + + async function subscribe() { + await session.push.subscribe(); + } + + async function ping() { + await api.sendPing(); + } </script> <ChangePassword {changePassword} /> <hr /> +<PushSubscription {subscription} {vapid} {subscribe} {ping} /> +<hr /> <Invites {invites} {createInvite} /> <hr /> <LogOut {logOut} /> |
