From 91c33501a315abe04aeed54aa27388ce0ad241ce Mon Sep 17 00:00:00 2001
From: Owen Jacobson <owen@grimoire.ca>
Date: Mon, 10 Nov 2025 20:51:11 -0500
Subject: Push messaging fixes:

* Remove push subscriptions on logout, to trigger a resubscription when logging back in.
* Don't try to call `this.push` when there's no `this` to have a `push` on.
---
 ui/routes/(app)/me/+page.svelte | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'ui/routes/(app)/me/+page.svelte')

diff --git a/ui/routes/(app)/me/+page.svelte b/ui/routes/(app)/me/+page.svelte
index a21d160..afdcbe4 100644
--- a/ui/routes/(app)/me/+page.svelte
+++ b/ui/routes/(app)/me/+page.svelte
@@ -17,12 +17,15 @@
   async function logOut() {
     const response = await api.logOut();
     if (200 <= response.status && response.status < 300) {
+      await session.push.unsubscribe();
       await goto('/login');
     }
   }
 
   async function changePassword(currentPassword, newPassword) {
     await api.changePassword(currentPassword, newPassword);
+    await session.push.unsubscribe();
+    await session.push.resubscribe();
   }
 
   async function createInvite() {
-- 
cgit v1.2.3

