ffplayout/stores/index.ts

27 lines
664 B
TypeScript
Raw Normal View History

2023-01-11 10:54:25 +01:00
import { defineStore } from 'pinia'
export const useIndex = defineStore('index', {
state: () => ({
2024-04-06 23:12:06 +02:00
darkMode: false,
2023-01-11 10:54:25 +01:00
showAlert: false,
alertVariant: 'success',
2023-01-11 10:54:25 +01:00
alertMsg: '',
2024-04-25 14:49:57 +02:00
sseConnected: false,
2023-01-11 10:54:25 +01:00
}),
getters: {},
actions: {
msgAlert(variance: string, text: string, seconds: number = 3) {
this.alertVariant = variance
this.alertMsg = text
this.showAlert = true
setTimeout(() => {
this.showAlert = false
this.alertVariant = 'success'
this.alertMsg = ''
}, seconds * 1000)
2023-01-11 10:54:25 +01:00
},
},
})