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:
parent
6365e07534
commit
dfa7cf9905
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user