From 491b6d19bb90ee7c851ab3eef1b76c571f987251 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 23 Sep 2023 16:21:16 +0200 Subject: [PATCH] Remove alert store logic --- src/stores/alerts.ts | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/src/stores/alerts.ts b/src/stores/alerts.ts index 6f91f208..eff40c96 100644 --- a/src/stores/alerts.ts +++ b/src/stores/alerts.ts @@ -1,22 +1,8 @@ -import { defineStore } from 'pinia'; -import { AlertSeverity, AlertType } from '@/types/alertTypes'; - -export const useAlertsStore = defineStore('alerts', { - state: () => { - return { activeMessages: [] as AlertType[] }; - }, - actions: { - addAlert(message: AlertType) { - this.activeMessages.push(message); - }, - removeAlert(alert: AlertType) { - console.log('dismissed', alert); - this.activeMessages = this.activeMessages.filter((v) => v !== alert); - }, - }, -}); +import { AlertSeverity } from '@/types/alertTypes'; +import { useToast } from 'bootstrap-vue-next'; export function showAlert(message: string, severity: AlertSeverity = 'warning') { - const alertsStore = useAlertsStore(); - alertsStore.addAlert({ message, severity, timeout: 5000 }); + const { show } = useToast(); + + show(message, { title: 'Msg', variant: severity, animation: true, value: true }); }