diff --git a/app/lib/browser/native-notifications.js b/app/lib/browser/native-notifications.js index 29b3dfa..cd68d4e 100644 --- a/app/lib/browser/native-notifications.js +++ b/app/lib/browser/native-notifications.js @@ -11,13 +11,6 @@ exports = module.exports = ({ ipc, iconPath }) => { body: this.options.body, icon: icon.toDataURL() }); - // ipc.send('notification-shown',{ - // title: this.title, - // options: { - // body: this.options.body, - // icon: icon.toDataURL() - // } - // }); notification.onclick = () => { ipc.send('nativeNotificationClick'); }; diff --git a/app/lib/browser/tray-notifications.js b/app/lib/browser/tray-notifications.js index 72d5815..c86f7b4 100755 --- a/app/lib/browser/tray-notifications.js +++ b/app/lib/browser/tray-notifications.js @@ -44,12 +44,10 @@ exports = module.exports = ({ ipc, iconPath }) => { console.log('notifications'); }); ipc.on('page-title', () => { - //console.log(); if (typeof angular === 'undefined') { return; } var element = angular.element(document.documentElement).controller(); - // console.log("document.documentElement", document.documentElement); if (!element) { return; } @@ -58,8 +56,9 @@ exports = module.exports = ({ ipc, iconPath }) => { if (lastCount !== count) { lastCount = count; - let toast = $.find('#toast-container > div > div > div.toast-message > p.title.app-max-2-lines-base')[0]; - let innerText = (toast) ? toast.innerText : "" + let toast = document.getElementById('toast-container'); + console.log('showing toast message'); + let innerText = (toast) ? toast.innerText.replace(/(\r\n|\n|\r)/gm," ") : "" buildIcon({ count, icon: nativeImage.createFromPath(iconPath) }).then( icon => { diff --git a/app/lib/index.js b/app/lib/index.js index 99f850a..21d9a9e 100755 --- a/app/lib/index.js +++ b/app/lib/index.js @@ -79,7 +79,7 @@ app.on('ready', () => { ipcMain.on('notifications', async (e, msg) => { if (msg.count>0){ - const body = "You got " + msg.count + " notification(s). " + ((msg.text) ? "Notification from '" + msg.text + "'" : ""); + const body = "You got " + msg.count + " notification(s). " + ((msg.text) ? " " + msg.text + " " : ""); const notification = new NativeNotification( "Microsoft Teams", { @@ -88,6 +88,7 @@ app.on('ready', () => { }); if (notification.show !== undefined) { notification.show(); + notification.on('click', () => alert('this')); } } }); diff --git a/package.json b/package.json index 5a4b51a..4b1c010 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "teams-for-linux", - "version": "0.1.0", + "version": "0.1.1", "description": "Unofficial client for Microsoft Teams for Linux", "homepage": "https://github.com/JamieMagee/teams-for-linux", "keywords": [