From 77f750496d9e6e0f9301646f4066dc53e4ad7fab Mon Sep 17 00:00:00 2001
From: Owen Jacobson <owen@grimoire.ca>
Date: Sat, 2 Nov 2024 13:38:19 -0400
Subject: Remove notification permissions prompt.

On Safari (iOS and macOS), the permissions prompt can only be done during a user gesture; mounting is sufficiently disconnected from any user gestures that it's not allowed. The browser raises an exception, which, since it is unhandled, then leaks out and interrupts SvelteKit's element unmounting, leading to the whole UI being duplicated when switching channels (the old UI is not unmounted).
---
 ui/routes/+layout.svelte | 8 --------
 1 file changed, 8 deletions(-)

(limited to 'ui/routes/+layout.svelte')

diff --git a/ui/routes/+layout.svelte b/ui/routes/+layout.svelte
index eb29179..a86a7e8 100644
--- a/ui/routes/+layout.svelte
+++ b/ui/routes/+layout.svelte
@@ -2,8 +2,6 @@
     import "../app.css";
     import logo from '$lib/assets/logo.png';
 
-    import { onMount } from 'svelte';
-
     import { AppBar } from '@skeletonlabs/skeleton';
     import { showMenu, currentUser } from '$lib/store';
 
@@ -12,12 +10,6 @@
     function toggleMenu() {
         showMenu.update((value) => !value);
     }
-
-    onMount(() => {
-        Notification.requestPermission().then((result) => {
-            console.log(result);
-        });
-    });
 </script>
 
 <div id="app" class="m-0 p-0 h-vh w-full">
-- 
cgit v1.2.3

