From 9ca03b7044b820a1fe4b6ab8fc690fb6c5312c73 Mon Sep 17 00:00:00 2001
From: Kit La Touche <kit@transneptune.net>
Date: Sun, 7 Sep 2025 22:19:30 -0400
Subject: Reformat things

---
 ui/lib/components/NotificationSettings.svelte | 77 ++++++++++++---------------
 1 file changed, 35 insertions(+), 42 deletions(-)

(limited to 'ui/lib/components/NotificationSettings.svelte')

diff --git a/ui/lib/components/NotificationSettings.svelte b/ui/lib/components/NotificationSettings.svelte
index f4a0e3f..94acb37 100644
--- a/ui/lib/components/NotificationSettings.svelte
+++ b/ui/lib/components/NotificationSettings.svelte
@@ -1,5 +1,5 @@
 <script>
-  import { onMount } from "svelte";
+  import { onMount } from 'svelte';
   import * as api from '$lib/apiServer.js';
   import Toggle from '$lib/components/Toggle.svelte';
 
@@ -9,15 +9,16 @@
     navigator.serviceWorker.ready
       .then(async (registration) => {
         // TODO: Get vapid key from remote.state instead:
-        const response = await fetch("/api/vapid");
+        const response = await fetch('/api/vapid');
         // and if we fail to get it?
         const vapidPublicKey = await response.text();
         const convertedVapidKey = vapidPublicKey;
         return registration.pushManager.subscribe({
           userVisibleOnly: true,
-          applicationServerKey: convertedVapidKey
+          applicationServerKey: convertedVapidKey,
         });
-      }).then((subscription) => {
+      })
+      .then((subscription) => {
         const subJson = subscription.toJSON();
         subscriptionJson = {
           endpoint: subJson.endpoint,
@@ -32,13 +33,13 @@
     navigator.serviceWorker.ready
       .then((registration) => {
         return registration.pushManager.getSubscription();
-      }).then((subscription) => {
+      })
+      .then((subscription) => {
         const { endpoint } = subscription.toJSON();
-        return subscription.unsubscribe()
-          .then(() => {
-            apiServer.deletePushSubscription({ endpoint });
-            subscriptionJson = null;
-          });
+        return subscription.unsubscribe().then(() => {
+          apiServer.deletePushSubscription({ endpoint });
+          subscriptionJson = null;
+        });
       });
   }
 
@@ -55,13 +56,15 @@
   }
 
   onMount(() => {
-    navigator.serviceWorker.ready.then((registration) => {
-      return registration.pushManager.getSubscription();
-    }).then((subscription) => {
-      if (subscription) {
-        subscriptionJson = JSON.parse(JSON.stringify(subscription));
-      }
-    });
+    navigator.serviceWorker.ready
+      .then((registration) => {
+        return registration.pushManager.getSubscription();
+      })
+      .then((subscription) => {
+        if (subscription) {
+          subscriptionJson = JSON.parse(JSON.stringify(subscription));
+        }
+      });
   });
 </script>
 
@@ -82,41 +85,31 @@
   {/if}
 </button>
 
-<button class="btn" onclick={testNotifications}>
-  Test notifications
-</button>
+<button class="btn" onclick={testNotifications}> Test notifications </button>
 
 <h2>Notify me when:</h2>
 
 <p>These are currently unimplemented.</p>
 
+<Toggle name="channel_created" text="A new channel is created" onclick={async () => {}} />
+<Toggle name="message_arrives" text="A new message arrives in a channel" onclick={async () => {}} />
 <Toggle
-    name="channel_created"
-    text="A new channel is created"
-    onclick={async () => {}}
-/>
-<Toggle
-    name="message_arrives"
-    text="A new message arrives in a channel"
-    onclick={async () => {}}
-/>
-<Toggle
-    name="message_arrives_username"
-    text="A new message containing your username arrives in a channel"
-    onclick={async () => {}}
+  name="message_arrives_username"
+  text="A new message containing your username arrives in a channel"
+  onclick={async () => {}}
 />
 <Toggle
-    name="message_arrives_keyword"
-    text="A new message containing a keyword you have configured arrives in a channel"
-    onclick={async () => {}}
+  name="message_arrives_keyword"
+  text="A new message containing a keyword you have configured arrives in a channel"
+  onclick={async () => {}}
 />
 <Toggle
-    name="own_message_stitched"
-    text="A message you wrote is stitched"
-    onclick={async () => {}}
+  name="own_message_stitched"
+  text="A message you wrote is stitched"
+  onclick={async () => {}}
 />
 <Toggle
-    name="flagged_message_stitched"
-    text="A message you have flagged is stitched"
-    onclick={async () => {}}
+  name="flagged_message_stitched"
+  text="A message you have flagged is stitched"
+  onclick={async () => {}}
 />
-- 
cgit v1.2.3

