From 8bb98c3044fada929ae61b0c25dd2206896377ef Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Mon, 10 Aug 2020 18:58:50 +0100 Subject: [PATCH] Implement maySendNotifications based upon dnd work --- src/vector/platform/ElectronPlatform.tsx | 4 ++-- src/vector/platform/WebPlatform.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vector/platform/ElectronPlatform.tsx b/src/vector/platform/ElectronPlatform.tsx index 7932c6433d..510acd6f43 100644 --- a/src/vector/platform/ElectronPlatform.tsx +++ b/src/vector/platform/ElectronPlatform.tsx @@ -335,8 +335,8 @@ export default class ElectronPlatform extends VectorBasePlatform { return true; } - maySendNotifications(): boolean { - return true; + async maySendNotifications(): Promise { + return this._ipcCall('getMaySendNotifications'); } displayNotification(title: string, msg: string, avatarUrl: string, room: Room): Notification { diff --git a/src/vector/platform/WebPlatform.ts b/src/vector/platform/WebPlatform.ts index 2e739a2660..35ec637f92 100644 --- a/src/vector/platform/WebPlatform.ts +++ b/src/vector/platform/WebPlatform.ts @@ -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 { return window.Notification.permission === 'granted'; }