mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +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
|
|
@ -2,8 +2,8 @@ import { browser } from '$app/environment';
|
|||
import { goto } from '$app/navigation';
|
||||
import { foldersStore } from '$lib/stores/folders.svelte';
|
||||
import { purchaseStore } from '$lib/stores/purchase.store';
|
||||
import { serverInfo } from '$lib/stores/server-info.store';
|
||||
import { preferences as preferences$, resetSavedUser, user as user$ } from '$lib/stores/user.store';
|
||||
import { resetUserInteraction, userInteraction } from '$lib/stores/user.svelte';
|
||||
import { getAboutInfo, getMyPreferences, getMyUser, getStorage } from '@immich/sdk';
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
import { DateTime } from 'luxon';
|
||||
|
|
@ -72,7 +72,7 @@ export const authenticate = async (options?: AuthOptions) => {
|
|||
export const requestServerInfo = async () => {
|
||||
if (get(user$)) {
|
||||
const data = await getStorage();
|
||||
serverInfo.set(data);
|
||||
userInteraction.serverInfo = data;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -99,6 +99,7 @@ export const handleLogout = async (redirectUri: string) => {
|
|||
}
|
||||
} finally {
|
||||
resetSavedUser();
|
||||
resetUserInteraction();
|
||||
foldersStore.clearCache();
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue