From 9ca03b7044b820a1fe4b6ab8fc690fb6c5312c73 Mon Sep 17 00:00:00 2001 From: Kit La Touche Date: Sun, 7 Sep 2025 22:19:30 -0400 Subject: Reformat things --- ui/lib/apiServer.js | 42 +++++---------- ui/lib/components/NotificationSettings.svelte | 77 ++++++++++++--------------- ui/lib/components/Toggle.svelte | 4 +- ui/routes/+layout.svelte | 2 +- ui/service-worker.js | 4 +- ui/styles/toggles.css | 2 +- 6 files changed, 55 insertions(+), 76 deletions(-) diff --git a/ui/lib/apiServer.js b/ui/lib/apiServer.js index fa9cbff..295c99a 100644 --- a/ui/lib/apiServer.js +++ b/ui/lib/apiServer.js @@ -7,75 +7,61 @@ export const apiServer = axios.create({ }); export async function boot() { - return apiServer.get('/boot') - .catch(responseError); + return apiServer.get('/boot').catch(responseError); } export async function setup(name, password) { - return await apiServer.post('/setup', { name, password }) - .catch(responseError); + return await apiServer.post('/setup', { name, password }).catch(responseError); } export async function logIn(name, password) { - return await apiServer.post('/auth/login', { name, password }) - .catch(responseError); + return await apiServer.post('/auth/login', { name, password }).catch(responseError); } export async function logOut() { - return await apiServer.post('/auth/logout', {}) - .catch(responseError); + return await apiServer.post('/auth/logout', {}).catch(responseError); } export async function changePassword(password, to) { - return await apiServer.post('/password', { password, to }) - .catch(responseError); + return await apiServer.post('/password', { password, to }).catch(responseError); } export async function createConversation(name) { - return await apiServer.post('/conversations', { name }) - .catch(responseError); + return await apiServer.post('/conversations', { name }).catch(responseError); } export async function sendToConversation(conversationId, body) { - return await apiServer.post(`/conversations/${conversationId}`, { body }) - .catch(responseError); + return await apiServer.post(`/conversations/${conversationId}`, { body }).catch(responseError); } export async function deleteMessage(messageId) { - return await apiServer.delete(`/messages/${messageId}`, {}) - .catch(responseError); + return await apiServer.delete(`/messages/${messageId}`, {}).catch(responseError); } export async function createInvite() { - return await apiServer.post(`/invite`, {}) - .catch(responseError); + return await apiServer.post(`/invite`, {}).catch(responseError); } export async function getInvite(inviteId) { - return await apiServer.get(`/invite/${inviteId}`) - .catch(responseError); + return await apiServer.get(`/invite/${inviteId}`).catch(responseError); } export async function acceptInvite(inviteId, name, password) { - return apiServer.post(`/invite/${inviteId}`, { name, password }) - .catch(responseError); + return apiServer.post(`/invite/${inviteId}`, { name, password }).catch(responseError); } export async function createPushSubscription(data) { - return await apiServer.post("/push", { data }) - .catch(responseError); + return await apiServer.post('/push', { data }).catch(responseError); } export async function deletePushSubscription(data) { - return await apiServer.delete("/push", { data }) - .catch(responseError); + return await apiServer.delete('/push', { data }).catch(responseError); } export async function notifyMe() { // TODO: this is the big "missing on the server" endpoint we need to make a // minimal notifications setup. - return await apiServer.post('/notifyMe') - .catch(responseError); + return await apiServer.post('/notifyMe').catch(responseError); } export function subscribeToEvents(resumePoint) { 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 @@ @@ -82,41 +85,31 @@ {/if} - +

Notify me when:

These are currently unimplemented.

+ {}} /> + {}} /> {}} -/> - {}} -/> - {}} + name="message_arrives_username" + text="A new message containing your username 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 () => {}} /> {}} + name="own_message_stitched" + text="A message you wrote is stitched" + onclick={async () => {}} /> {}} + name="flagged_message_stitched" + text="A message you have flagged is stitched" + onclick={async () => {}} /> diff --git a/ui/lib/components/Toggle.svelte b/ui/lib/components/Toggle.svelte index 7e71b5a..e880d37 100644 --- a/ui/lib/components/Toggle.svelte +++ b/ui/lib/components/Toggle.svelte @@ -4,8 +4,8 @@ diff --git a/ui/routes/+layout.svelte b/ui/routes/+layout.svelte index 8412fbc..83a9ef7 100644 --- a/ui/routes/+layout.svelte +++ b/ui/routes/+layout.svelte @@ -1,5 +1,5 @@