From cd52d9ae6c13e37dac6a6783840fbc3bc51442f6 Mon Sep 17 00:00:00 2001 From: djmaze Date: Tue, 10 Nov 2020 09:59:56 +0100 Subject: [PATCH] More improvements for https://github.com/the-djmaze/snappymail/issues/37 --- dev/Settings/User/General.js | 2 +- dev/Stores/User/Message.js | 6 ++---- dev/Stores/User/Notification.js | 2 ++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dev/Settings/User/General.js b/dev/Settings/User/General.js index df9a994c7..28830a504 100644 --- a/dev/Settings/User/General.js +++ b/dev/Settings/User/General.js @@ -95,7 +95,7 @@ class GeneralUserSettings { } testSystemNotification() { - NotificationStore.displayDesktopNotification('SnappyMail', 'Test notification', { 'Folder': '', 'Uid': '' }); + NotificationStore.displayDesktopNotification('SnappyMail', 'Test notification', { }); } onBuild() { diff --git a/dev/Stores/User/Message.js b/dev/Stores/User/Message.js index 4cb62277c..5ff67af31 100644 --- a/dev/Stores/User/Message.js +++ b/dev/Stores/User/Message.js @@ -236,9 +236,7 @@ class MessageUserStore { initUidNextAndNewMessages(folder, uidNext, newMessages) { if (getFolderInboxName() === folder && uidNext) { if (Array.isNotEmpty(newMessages)) { - newMessages.forEach(item => { - addNewMessageCache(folder, item.Uid); - }); + newMessages.forEach(item => addNewMessageCache(folder, item.Uid)); NotificationStore.playSoundNotification(); @@ -249,7 +247,7 @@ class MessageUserStore { i18n('MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION', { 'COUNT': len }), - { 'Folder': '', 'Uid': '' } + { 'Url': mailBox(newMessages[0].Folder, 1) } ); } else { newMessages.forEach(item => { diff --git a/dev/Stores/User/Notification.js b/dev/Stores/User/Notification.js index d1aa092b3..11ba84c65 100644 --- a/dev/Stores/User/Notification.js +++ b/dev/Stores/User/Notification.js @@ -14,6 +14,8 @@ const HTML5Notification = window.Notification ? Notification : null, focus(); if (data.Folder && data.Uid) { dispatchEvent(new CustomEvent('mailbox.message.show', {detail:data})); + } else if (data.Url) { + rl.route.setHash(data.Url); } };