diff --git a/src/renderer/stores/notifications.ts b/src/renderer/stores/notifications.ts index 9c01383e..62d0954b 100644 --- a/src/renderer/stores/notifications.ts +++ b/src/renderer/stores/notifications.ts @@ -1,6 +1,8 @@ import { uidGen } from 'common/libs/uidGen'; import { defineStore } from 'pinia'; +import { useConsoleStore } from './console'; + export interface Notification { uid: string; status: string; @@ -15,6 +17,13 @@ export const useNotificationsStore = defineStore('notifications', { addNotification (payload: { status: string; message: string }) { const notification: Notification = { uid: uidGen('N'), ...payload }; this.notifications.unshift(notification); + + useConsoleStore().putLog('debug', { + level: notification.status, + process: 'renderer', + message: notification.message, + date: new Date() + }); }, removeNotification (uid: string) { this.notifications = (this.notifications as Notification[]).filter(item => item.uid !== uid);