feat: error handing: alert -> dialog
This commit is contained in:
23
frontend/src/stores/error.store.ts
Normal file
23
frontend/src/stores/error.store.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
export interface ErrorState {
|
||||
show: boolean
|
||||
message: string
|
||||
}
|
||||
|
||||
export const useErrorStore = defineStore("error", {
|
||||
state: (): ErrorState => ({
|
||||
show: false,
|
||||
message: ""
|
||||
}),
|
||||
actions: {
|
||||
summon(message: string) {
|
||||
this.show = true
|
||||
this.message = message
|
||||
},
|
||||
close() {
|
||||
this.show = false
|
||||
this.message = ""
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user