aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src-vue/src/i18n/lang/en.json1
-rw-r--r--src-vue/src/i18n/lang/fr.json1
-rw-r--r--src-vue/src/utils/ui.ts6
3 files changed, 7 insertions, 1 deletions
diff --git a/src-vue/src/i18n/lang/en.json b/src-vue/src/i18n/lang/en.json
index 6fa6a965..6bbb6919 100644
--- a/src-vue/src/i18n/lang/en.json
+++ b/src-vue/src/i18n/lang/en.json
@@ -146,6 +146,7 @@
},
"notification": {
+ "date_prefix": "at",
"no_new": {
"title": "Up-to-date",
"text": "Nothing to see here!"
diff --git a/src-vue/src/i18n/lang/fr.json b/src-vue/src/i18n/lang/fr.json
index 076806a5..d2de46b0 100644
--- a/src-vue/src/i18n/lang/fr.json
+++ b/src-vue/src/i18n/lang/fr.json
@@ -131,6 +131,7 @@
}
},
"notification": {
+ "date_prefix": "à",
"no_new": {
"title": "Vous êtes à jour",
"text": "Rien à voir par ici !"
diff --git a/src-vue/src/utils/ui.ts b/src-vue/src/utils/ui.ts
index 4c735a9c..f5183bcc 100644
--- a/src-vue/src/utils/ui.ts
+++ b/src-vue/src/utils/ui.ts
@@ -1,4 +1,5 @@
import { ElNotification, NotificationHandle } from "element-plus";
+import { appWindow, UserAttentionType } from '@tauri-apps/api/window';
import { i18n } from "../main";
import { store } from "../plugins/store";
@@ -13,7 +14,10 @@ function showNotification(
duration: number = 4500
): NotificationHandle {
if (!document.hasFocus()) {
- store.commit('addNotification', {title, text: message, type});
+ const date = new Date();
+ const titleWithDate = `${title} (${i18n.global.tc('notification.date_prefix')} ${('0' + date.getHours()).slice(-2)}:${('0' + date.getMinutes()).slice(-2)})`;
+ store.commit('addNotification', {title: titleWithDate, text: message, type});
+ appWindow.requestUserAttention(UserAttentionType.Informational);
}
return ElNotification({