From 9bde255382ebbf4f843a3b66e695bdd0ae9de965 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Wed, 7 Feb 2024 06:07:34 -0800
Subject: fix(layout): single identity fetch

---
 src/routes/+layout.svelte | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

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

diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index cc09bb94..4665173f 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -70,10 +70,8 @@
 
 		settings.get();
 
-		if (data.user !== undefined)
-			getUserIdentity(data.user).then((h) => {
-				if ($userIdentity.id === -2) userIdentity.set(h);
-			});
+		if (data.user !== undefined && $userIdentity.id === -2)
+			getUserIdentity(data.user).then((h) => userIdentity.set(h));
 	});
 
 	$: {
-- 
cgit v1.2.3

