1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-04-24 14:58:41 +02:00

perf: added more notifications in debug console

This commit is contained in:
Fabio Di Stasio 2024-10-25 18:32:07 +02:00
parent 6365e07534
commit dfa7cf9905

View File

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