Skip to content

Commit

Permalink
Fixes to electron desktop notifs
Browse files Browse the repository at this point in the history
Merge the notification part of element-hq#2960

 * Show and focus the window when the notification is clicked,
   rather than just restoring it.
 * Implement requestNotificationPermission and return a resolved
   promise (although in practice it should never be called)
  • Loading branch information
dbkr authored and Half-Shot committed Feb 9, 2017
1 parent 1f2e46a commit 2395aed
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/vector/platform/ElectronPlatform.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ export default class ElectronPlatform extends VectorBasePlatform {
room_id: room.roomId
});
global.focus();
electron.remote.getCurrentWindow().restore();
const currentWin = electron.remote.getCurrentWindow();
currentWin.show();
currentWin.restore();
currentWin.focus();
};

return notification;
Expand Down Expand Up @@ -131,4 +134,8 @@ export default class ElectronPlatform extends VectorBasePlatform {
screenCaptureErrorString() {
return null;
}

requestNotificationPermission() : Promise {
return q('granted');
}
}

0 comments on commit 2395aed

Please sign in to comment.