mirror of
https://github.com/immich-app/immich
synced 2025-06-08 09:20:57 +00:00
30 lines
776 B
TypeScript
30 lines
776 B
TypeScript
import { eventManager } from '$lib/managers/event-manager.svelte';
|
|
import type {
|
|
AlbumResponseDto,
|
|
ServerAboutResponseDto,
|
|
ServerStorageResponseDto,
|
|
ServerVersionHistoryResponseDto,
|
|
} from '@immich/sdk';
|
|
|
|
interface UserInteractions {
|
|
recentAlbums?: AlbumResponseDto[];
|
|
versions?: ServerVersionHistoryResponseDto[];
|
|
aboutInfo?: ServerAboutResponseDto;
|
|
serverInfo?: ServerStorageResponseDto;
|
|
}
|
|
|
|
const defaultUserInteraction: UserInteractions = {
|
|
recentAlbums: undefined,
|
|
versions: undefined,
|
|
aboutInfo: undefined,
|
|
serverInfo: undefined,
|
|
};
|
|
|
|
export const userInteraction = $state<UserInteractions>(defaultUserInteraction);
|
|
|
|
const reset = () => {
|
|
Object.assign(userInteraction, defaultUserInteraction);
|
|
};
|
|
|
|
eventManager.on('auth.logout', () => reset());
|