2024-02-14 15:38:57 +01:00
|
|
|
import type { UserResponseDto } from '@immich/sdk';
|
2024-02-13 02:47:26 +01:00
|
|
|
import { writable } from 'svelte/store';
|
2023-12-01 21:58:24 +01:00
|
|
|
|
2024-02-20 15:20:09 +01:00
|
|
|
export const user = writable<UserResponseDto>();
|
2023-12-12 03:35:57 +01:00
|
|
|
|
2024-02-20 15:20:09 +01:00
|
|
|
/**
|
|
|
|
* Reset the store to its initial undefined value. Make sure to
|
|
|
|
* only do this _after_ redirecting to an unauthenticated page.
|
|
|
|
*/
|
2023-12-15 03:29:05 +01:00
|
|
|
export const resetSavedUser = () => {
|
2024-02-20 15:20:09 +01:00
|
|
|
user.set(undefined as unknown as UserResponseDto);
|
2023-12-15 03:29:05 +01:00
|
|
|
};
|