From 47c4411ee69795aa722d58dc7f33f66ac7a89726 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Fri, 26 Jan 2024 23:29:43 -0800
Subject: fix(layout): eager identity fetch

---
 src/routes/+layout.svelte | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

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

diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index bfece966..c56c42be 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -45,13 +45,6 @@
 		? 200
 		: -200;
 
-	$: {
-		if (data.user !== undefined)
-			getUserIdentity(data.user).then((h) => {
-				if ($userIdentity.id === -2) userIdentity.set(h);
-			});
-	}
-
 	onMount(async () => {
 		if (browser && localStorage.getItem('redirect')) {
 			window.location.href = localStorage.getItem('redirect') ?? '/';
@@ -60,6 +53,11 @@
 		}
 
 		settings.get();
+
+		if (data.user !== undefined)
+			getUserIdentity(data.user).then((h) => {
+				if ($userIdentity.id === -2) userIdentity.set(h);
+			});
 	});
 </script>
 
-- 
cgit v1.2.3

