fix: auth race condition on refresh, section edit dialog, time slot duplicate, autocomplete disable
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
24
apps/app/src/stores/useNotificationStore.ts
Normal file
24
apps/app/src/stores/useNotificationStore.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
|
||||
export type NotificationType = 'success' | 'error' | 'warning' | 'info'
|
||||
|
||||
export const useNotificationStore = defineStore('notification', () => {
|
||||
const visible = ref(false)
|
||||
const message = ref('')
|
||||
const type = ref<NotificationType>('info')
|
||||
const timeout = ref(5000)
|
||||
|
||||
function show(msg: string, color: NotificationType = 'error', duration = 5000) {
|
||||
message.value = msg
|
||||
type.value = color
|
||||
timeout.value = duration
|
||||
visible.value = true
|
||||
}
|
||||
|
||||
function hide() {
|
||||
visible.value = false
|
||||
}
|
||||
|
||||
return { visible, message, type, timeout, show, hide }
|
||||
})
|
||||
Reference in New Issue
Block a user