scholarr/frontend/src/stores/ui.ts
2026-02-17 20:24:12 +01:00

20 lines
426 B
TypeScript

import { defineStore } from "pinia";
export interface GlobalErrorState {
message: string;
requestId: string | null;
}
export const useUiStore = defineStore("ui", {
state: () => ({
globalError: null as GlobalErrorState | null,
}),
actions: {
setGlobalError(error: GlobalErrorState): void {
this.globalError = error;
},
clearGlobalError(): void {
this.globalError = null;
},
},
});