From 78d901328261d2306cf59c8e83fc217a63aa4a64 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Sun, 26 Oct 2025 16:46:04 -0400 Subject: Add a button to the client to set up a push subscription. Once a user has set up a push subscription, the client will re-establish it as needed whenever possible, falling back to manual intervention only when it is unable to create a push subscription. This change imposes some architectural changes to the client, though they're not huge: the `session` type now includes a body of state (`push`) whose methods also call into the Pilcrow API. Previously, calls to the API were not made within the `session` types, and were instead only made by page and layout code, but orchestrating that for the push subscription lifecycle proved too complex to deal with. This is an experimental alternative, but it might be something we explore further in the future. --- ui/lib/state/remote/state.svelte.js | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'ui/lib/state/remote/state.svelte.js') diff --git a/ui/lib/state/remote/state.svelte.js b/ui/lib/state/remote/state.svelte.js index 8845e02..3d65e4a 100644 --- a/ui/lib/state/remote/state.svelte.js +++ b/ui/lib/state/remote/state.svelte.js @@ -7,7 +7,6 @@ export class State { users = $state(new Users()); conversations = $state(new Conversations()); messages = $state(new Messages()); - vapid_key = $state(null); static boot({ currentUser, heartbeat, resumePoint, events }) { const state = new State({ @@ -37,8 +36,6 @@ export class State { return this.onUserEvent(event); case 'message': return this.onMessageEvent(event); - case 'vapid': - return this.onVapidEvent(event); } } @@ -91,16 +88,4 @@ export class State { const { id } = event; this.messages.remove(id); } - - onVapidEvent(event) { - switch (event.event) { - case 'changed': - return this.onVapidChanged(event); - } - } - - onVapidChanged(event) { - let { key } = event; - this.vapid_key = key; - } } -- cgit v1.2.3