From 7fe9fcf050da26f17d11fe7340678fca12fec290 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 12 Aug 2020 12:16:28 +0100 Subject: [PATCH] Try to close notification on all platforms which support it, not just electron --- src/BasePlatform.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/BasePlatform.ts b/src/BasePlatform.ts index 1d28aa7f9a..4d06c5df73 100644 --- a/src/BasePlatform.ts +++ b/src/BasePlatform.ts @@ -155,7 +155,13 @@ export default abstract class BasePlatform { loudNotification(ev: Event, room: Object) { } + clearNotification(notif: Notification) { + // Some browsers don't support this, e.g Safari on iOS + // https://developer.mozilla.org/en-US/docs/Web/API/Notification/close + if (notif.close) { + notif.close(); + } } /**