mirror of
https://github.com/hay-kot/homebox.git
synced 2025-08-04 16:50:27 +00:00
change verbage
This commit is contained in:
parent
a1d2a57709
commit
06d3fd9ed2
3 changed files with 5 additions and 6 deletions
|
@ -85,6 +85,6 @@
|
||||||
importRef.value.value = "";
|
importRef.value.value = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
eventBus.emit(EventTypes.ClearStores);
|
eventBus.emit(EventTypes.InvalidStores);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -2,7 +2,7 @@ export enum EventTypes {
|
||||||
// ClearStores event is used to inform the stores that _all_ the data they are using
|
// 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
|
// 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
|
// changes to the data such as bulk actions or importing a CSV file
|
||||||
ClearStores,
|
InvalidStores,
|
||||||
}
|
}
|
||||||
|
|
||||||
export type EventFn = () => void;
|
export type EventFn = () => void;
|
||||||
|
@ -15,7 +15,7 @@ export interface IEventBus {
|
||||||
|
|
||||||
class EventBus implements IEventBus {
|
class EventBus implements IEventBus {
|
||||||
private listeners: Record<EventTypes, Record<string, EventFn>> = {
|
private listeners: Record<EventTypes, Record<string, EventFn>> = {
|
||||||
[EventTypes.ClearStores]: {},
|
[EventTypes.InvalidStores]: {},
|
||||||
};
|
};
|
||||||
|
|
||||||
on(event: EventTypes, fn: EventFn, key: string): void {
|
on(event: EventTypes, fn: EventFn, key: string): void {
|
||||||
|
|
|
@ -214,7 +214,7 @@
|
||||||
|
|
||||||
const eventBus = useEventBus();
|
const eventBus = useEventBus();
|
||||||
eventBus.on(
|
eventBus.on(
|
||||||
EventTypes.ClearStores,
|
EventTypes.InvalidStores,
|
||||||
() => {
|
() => {
|
||||||
labelStore.refresh();
|
labelStore.refresh();
|
||||||
locationStore.refreshChildren();
|
locationStore.refreshChildren();
|
||||||
|
@ -226,7 +226,7 @@
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
rmLabelStoreObserver();
|
rmLabelStoreObserver();
|
||||||
rmLocationStoreObserver();
|
rmLocationStoreObserver();
|
||||||
eventBus.off(EventTypes.ClearStores, "stores");
|
eventBus.off(EventTypes.InvalidStores, "stores");
|
||||||
});
|
});
|
||||||
|
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore();
|
||||||
|
@ -238,7 +238,6 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
eventBus.emit(EventTypes.ClearStores);
|
|
||||||
navigateTo("/");
|
navigateTo("/");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue