diff --git a/main.js b/main.js index 0f69451..2649604 100644 --- a/main.js +++ b/main.js @@ -488,6 +488,13 @@ const createMainWindow = () => { } }); + ipcMain.on('show-window', event => { + if (!mainWindow.isVisible()) { + mainWindow.show(); + mainWindow.focus(); + } + }); + ipcMain.on('menu-update', (event, args) => { var { contacts, conversations } = args; diff --git a/src/js/stores/chat.js b/src/js/stores/chat.js index efc09a8..ba76c91 100644 --- a/src/js/stores/chat.js +++ b/src/js/stores/chat.js @@ -372,13 +372,15 @@ class Chat { if (!helper.isMuted(user) && !sync && settings.showNotification) { - /* eslint-disable */ - new Notification(title, { + let notification = new window.Notification(title, { icon: user.HeadImgUrl, body: helper.getMessageContent(message), vibrate: [200, 100, 200], }); - /* eslint-enable */ + + notification.onclick = () => { + ipcRenderer.send('show-window'); + }; } list.data.push(message); }