Implement maySendNotifications based upon dnd work

hs/dnd
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;
}
maySendNotifications(): boolean {
return true;
async maySendNotifications(): Promise<boolean> {
return this._ipcCall('getMaySendNotifications');
}
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
* to display notifications. Otherwise false.
*/
maySendNotifications(): boolean {
async maySendNotifications(): Promise<boolean> {
return window.Notification.permission === 'granted';
}