fix read-receipt being sent onFocus on invalid conversation

pull/1337/head
Audric Ackermann 5 years ago
parent 0290c9a2bf
commit a5474ac5e2
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -65,7 +65,8 @@ function createTrayIcon(getMainWindow, messages) {
trayContextMenu = Menu.buildFromTemplate([ trayContextMenu = Menu.buildFromTemplate([
{ {
id: 'toggleWindowVisibility', id: 'toggleWindowVisibility',
label: messages[mainWindow.isVisible() ? 'appMenuHide' : 'show'].message, label:
messages[mainWindow.isVisible() ? 'appMenuHide' : 'show'].message,
click: tray.toggleWindowVisibility, click: tray.toggleWindowVisibility,
}, },
{ {

@ -391,7 +391,10 @@
this.window.addEventListener('resize', this.onResize); this.window.addEventListener('resize', this.onResize);
this.onFocus = () => { this.onFocus = () => {
if (this.$el.css('display') !== 'none') { if (
this.$el.css('display') !== 'none' &&
this.$el.css('display') !== ''
) {
this.markRead(); this.markRead();
} }
}; };

Loading…
Cancel
Save