feat(web): event handler component (#23763)

This commit is contained in:
Daniel Dietzler
2025-11-10 17:49:46 +01:00
committed by GitHub
parent 493cde9d55
commit dd393c8346
14 changed files with 58 additions and 23 deletions
+1 -1
View File
@@ -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> {
+1 -1
View File
@@ -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() {
+1 -1
View File
@@ -5,7 +5,7 @@ class SearchStore {
isSearchEnabled = $state(false);
constructor() {
eventManager.on('auth.logout', () => this.clearCache());
eventManager.on('AuthLogout', () => this.clearCache());
}
clearCache() {
+1 -1
View File
@@ -16,4 +16,4 @@ export const resetSavedUser = () => {
purchaseStore.setPurchaseStatus(false);
};
eventManager.on('auth.logout', () => resetSavedUser());
eventManager.on('AuthLogout', () => resetSavedUser());
+1 -1
View File
@@ -26,4 +26,4 @@ const reset = () => {
Object.assign(userInteraction, defaultUserInteraction);
};
eventManager.on('auth.logout', () => reset());
eventManager.on('AuthLogout', () => reset());