diff --git a/frontend/components/App/ImportDialog.vue b/frontend/components/App/ImportDialog.vue index 6fe8997..fec49f2 100644 --- a/frontend/components/App/ImportDialog.vue +++ b/frontend/components/App/ImportDialog.vue @@ -85,6 +85,6 @@ importRef.value.value = ""; } - eventBus.emit(EventTypes.ClearStores); + eventBus.emit(EventTypes.InvalidStores); } diff --git a/frontend/composables/use-events.ts b/frontend/composables/use-events.ts index 3c1af07..92c8cdd 100644 --- a/frontend/composables/use-events.ts +++ b/frontend/composables/use-events.ts @@ -2,7 +2,7 @@ export enum EventTypes { // ClearStores event is used to inform the stores that _all_ the data they are using // is now out of date and they should refresh - This is used when the user makes large // changes to the data such as bulk actions or importing a CSV file - ClearStores, + InvalidStores, } export type EventFn = () => void; @@ -15,7 +15,7 @@ export interface IEventBus { class EventBus implements IEventBus { private listeners: Record> = { - [EventTypes.ClearStores]: {}, + [EventTypes.InvalidStores]: {}, }; on(event: EventTypes, fn: EventFn, key: string): void { diff --git a/frontend/layouts/default.vue b/frontend/layouts/default.vue index b4203ef..6a17bf2 100644 --- a/frontend/layouts/default.vue +++ b/frontend/layouts/default.vue @@ -214,7 +214,7 @@ const eventBus = useEventBus(); eventBus.on( - EventTypes.ClearStores, + EventTypes.InvalidStores, () => { labelStore.refresh(); locationStore.refreshChildren(); @@ -226,7 +226,7 @@ onUnmounted(() => { rmLabelStoreObserver(); rmLocationStoreObserver(); - eventBus.off(EventTypes.ClearStores, "stores"); + eventBus.off(EventTypes.InvalidStores, "stores"); }); const authStore = useAuthStore(); @@ -238,7 +238,6 @@ return; } - eventBus.emit(EventTypes.ClearStores); navigateTo("/"); }