mirror of
https://github.com/immich-app/immich.git
synced 2025-11-16 12:12:37 +09: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:
@@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user