mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
fix: reduce the number of API requests when changing route (#14666)
* fix: reduce the number of API requests when changing route * fix: reset `userInteraction` after sign out
This commit is contained in:
parent
6b0f9ec46c
commit
8945a5d862
9 changed files with 63 additions and 20 deletions
|
|
@ -7,6 +7,7 @@
|
|||
import Icon from '$lib/components/elements/icon.svelte';
|
||||
import { featureFlags } from '$lib/stores/server-config.store';
|
||||
import { user } from '$lib/stores/user.store';
|
||||
import { userInteraction } from '$lib/stores/user.svelte';
|
||||
import { handleLogout } from '$lib/utils/auth';
|
||||
import { getAboutInfo, logout, type ServerAboutResponseDto } from '@immich/sdk';
|
||||
import { mdiHelpCircleOutline, mdiMagnify, mdiTrayArrowUp } from '@mdi/js';
|
||||
|
|
@ -38,17 +39,17 @@
|
|||
await handleLogout(redirectUri);
|
||||
};
|
||||
|
||||
let aboutInfo: ServerAboutResponseDto | undefined = $state();
|
||||
let info: ServerAboutResponseDto | undefined = $state();
|
||||
|
||||
onMount(async () => {
|
||||
aboutInfo = await getAboutInfo();
|
||||
info = userInteraction.aboutInfo ?? (await getAboutInfo());
|
||||
});
|
||||
</script>
|
||||
|
||||
<svelte:window bind:innerWidth />
|
||||
|
||||
{#if shouldShowHelpPanel && aboutInfo}
|
||||
<HelpAndFeedbackModal onClose={() => (shouldShowHelpPanel = false)} info={aboutInfo} />
|
||||
{#if shouldShowHelpPanel && info}
|
||||
<HelpAndFeedbackModal onClose={() => (shouldShowHelpPanel = false)} {info} />
|
||||
{/if}
|
||||
|
||||
<section id="dashboard-navbar" class="fixed z-[900] h-[var(--navbar-height)] w-screen text-sm">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue