Implement maySendNotifications based upon dnd work

This commit is contained in:
Will Hunt 2020-08-10 18:58:50 +01:00
parent 48b994d87c
commit 8bb98c3044
2 changed files with 3 additions and 3 deletions

View file

@ -335,8 +335,8 @@ export default class ElectronPlatform extends VectorBasePlatform {
return true; return true;
} }
maySendNotifications(): boolean { async maySendNotifications(): Promise<boolean> {
return true; return this._ipcCall('getMaySendNotifications');
} }
displayNotification(title: string, msg: string, avatarUrl: string, room: Room): Notification { displayNotification(title: string, msg: string, avatarUrl: string, room: Room): Notification {

View file

@ -50,7 +50,7 @@ export default class WebPlatform extends VectorBasePlatform {
* Returns true if the application currently has permission * Returns true if the application currently has permission
* to display notifications. Otherwise false. * to display notifications. Otherwise false.
*/ */
maySendNotifications(): boolean { async maySendNotifications(): Promise<boolean> {
return window.Notification.permission === 'granted'; return window.Notification.permission === 'granted';
} }