show notification in frontend

This commit is contained in:
MaysWind
2024-08-05 23:59:57 +08:00
parent 051c319890
commit 0e946a4b3b
12 changed files with 133 additions and 5 deletions
+8
View File
@@ -17,6 +17,9 @@ import logger from '@/lib/logger.js';
import { isObject, isString } from '@/lib/common.js';
export const useRootStore = defineStore('root', {
state: () => ({
currentNotification: null
}),
actions: {
resetAllStates(resetUserInfoAndSettings) {
if (resetUserInfoAndSettings) {
@@ -24,6 +27,8 @@ export const useRootStore = defineStore('root', {
exchangeRatesStore.resetLatestExchangeRates();
}
this.setNotificationContent(null);
const statisticsStore = useStatisticsStore();
statisticsStore.resetTransactionStatistics();
@@ -511,6 +516,9 @@ export const useRootStore = defineStore('root', {
}
});
});
},
setNotificationContent(content) {
this.currentNotification = content;
}
}
});