aboutsummaryrefslogtreecommitdiff
path: root/src/routes
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-01-26 23:29:43 -0800
committerFuwn <[email protected]>2024-01-26 23:29:43 -0800
commit47c4411ee69795aa722d58dc7f33f66ac7a89726 (patch)
tree226200180bb42e0d2ea2438cecf7ed6eedff4fb1 /src/routes
parentfix(limitlistheight): ignore hover cover (diff)
downloaddue.moe-47c4411ee69795aa722d58dc7f33f66ac7a89726.tar.xz
due.moe-47c4411ee69795aa722d58dc7f33f66ac7a89726.zip
fix(layout): eager identity fetch
Diffstat (limited to 'src/routes')
-rw-r--r--src/routes/+layout.svelte12
1 files changed, 5 insertions, 7 deletions
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>