From 4d771d8ebdb33a2b521e031fd0e9d7f798dc3b73 Mon Sep 17 00:00:00 2001 From: ari melody Date: Sun, 7 Jul 2024 14:58:59 +0100 Subject: [PATCH] finish URL rewrite, remove redundant logged_in state --- src/lib/stores/account.js | 1 - src/lib/ui/Navigation.svelte | 14 ++++++-------- src/lib/ui/Notification.svelte | 6 +++--- src/lib/ui/post/ReplyContext.svelte | 4 ++-- src/routes/+layout.svelte | 4 +--- src/routes/+page.svelte | 3 +-- src/routes/[server]/[account]/[post]/+page.svelte | 3 ++- src/routes/callback/+page.svelte | 3 +-- src/routes/notifications/+page.svelte | 9 ++++----- 9 files changed, 20 insertions(+), 27 deletions(-) diff --git a/src/lib/stores/account.js b/src/lib/stores/account.js index 8361624..5c6fecc 100644 --- a/src/lib/stores/account.js +++ b/src/lib/stores/account.js @@ -1,4 +1,3 @@ import { writable } from 'svelte/store'; export let account = writable(false); -export let logged_in = writable(false); diff --git a/src/lib/ui/Navigation.svelte b/src/lib/ui/Navigation.svelte index 6540562..47b95f5 100644 --- a/src/lib/ui/Navigation.svelte +++ b/src/lib/ui/Navigation.svelte @@ -1,6 +1,6 @@ diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 9b2964b..aec6b96 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -3,7 +3,7 @@ import * as api from '$lib/api.js'; import { server } from '$lib/client/server.js'; import { app } from '$lib/client/app.js'; - import { account, logged_in } from '$lib/stores/account.js'; + import { account } from '$lib/stores/account.js'; import { parseAccount } from '$lib/account.js'; import { unread_notif_count, last_read_notif_id } from '$lib/notifications.js'; @@ -17,7 +17,6 @@ async function init() { if (!$app || !$app.token) { account.set(false); - logged_in.set(false); return; } @@ -26,7 +25,6 @@ if (!data) return; account.set(parseAccount(data)); - logged_in.set(true); console.log(`Logged in as @${$account.username}@${$account.host}`); // spin up async task to fetch notifications diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index e51ef77..156a07b 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,6 +1,5 @@