Skip to content

Commit bee4ca2

Browse files
committed
Fixes to electron desktop notifs
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)
1 parent 231adbc commit bee4ca2

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎src/vector/platform/ElectronPlatform.js‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ export default class ElectronPlatform extends VectorBasePlatform {
9797
room_id: room.roomId
9898
});
9999
global.focus();
100-
electron.remote.getCurrentWindow().restore();
100+
const currentWin = electron.remote.getCurrentWindow();
101+
currentWin.show();
102+
currentWin.restore();
103+
currentWin.focus();
101104
};
102105

103106
return notification;
@@ -131,4 +134,8 @@ export default class ElectronPlatform extends VectorBasePlatform {
131134
screenCaptureErrorString() {
132135
return null;
133136
}
137+
138+
requestNotificationPermission() : Promise {
139+
return q('granted');
140+
}
134141
}

0 commit comments

Comments
 (0)