mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
feat(web): event handler component (#23763)
This commit is contained in:
@@ -19,7 +19,7 @@ class FoldersStore {
|
||||
private assets = $state<AssetCache>({});
|
||||
|
||||
constructor() {
|
||||
eventManager.on('auth.logout', () => this.clearCache());
|
||||
eventManager.on('AuthLogout', () => this.clearCache());
|
||||
}
|
||||
|
||||
async fetchTree(): Promise<TreeNode> {
|
||||
|
||||
@@ -21,7 +21,7 @@ export type MemoryAsset = MemoryIndex & {
|
||||
|
||||
class MemoryStoreSvelte {
|
||||
constructor() {
|
||||
eventManager.on('auth.logout', () => this.clearCache());
|
||||
eventManager.on('AuthLogout', () => this.clearCache());
|
||||
}
|
||||
|
||||
memories = $state<MemoryResponseDto[]>([]);
|
||||
|
||||
@@ -9,8 +9,8 @@ class NotificationStore {
|
||||
notifications = $state<NotificationDto[]>([]);
|
||||
|
||||
constructor() {
|
||||
eventManager.on('auth.login', () => handlePromiseError(this.refresh()));
|
||||
eventManager.on('auth.logout', () => this.clear());
|
||||
eventManager.on('AuthLogin', () => handlePromiseError(this.refresh()));
|
||||
eventManager.on('AuthLogout', () => this.clear());
|
||||
}
|
||||
|
||||
async refresh() {
|
||||
|
||||
@@ -5,7 +5,7 @@ class SearchStore {
|
||||
isSearchEnabled = $state(false);
|
||||
|
||||
constructor() {
|
||||
eventManager.on('auth.logout', () => this.clearCache());
|
||||
eventManager.on('AuthLogout', () => this.clearCache());
|
||||
}
|
||||
|
||||
clearCache() {
|
||||
|
||||
@@ -16,4 +16,4 @@ export const resetSavedUser = () => {
|
||||
purchaseStore.setPurchaseStatus(false);
|
||||
};
|
||||
|
||||
eventManager.on('auth.logout', () => resetSavedUser());
|
||||
eventManager.on('AuthLogout', () => resetSavedUser());
|
||||
|
||||
@@ -26,4 +26,4 @@ const reset = () => {
|
||||
Object.assign(userInteraction, defaultUserInteraction);
|
||||
};
|
||||
|
||||
eventManager.on('auth.logout', () => reset());
|
||||
eventManager.on('AuthLogout', () => reset());
|
||||
|
||||
Reference in New Issue
Block a user