diff --git a/app/package.json b/app/package.json index eb03c80d9f4..6db9a3e314d 100644 --- a/app/package.json +++ b/app/package.json @@ -26,7 +26,7 @@ "codemirror-mode-elixir": "^1.1.2", "compare-versions": "^3.6.0", "deep-equal": "^1.0.1", - "desktop-notifications": "^0.2.1", + "desktop-notifications": "^0.2.2", "desktop-trampoline": "desktop/desktop-trampoline#v0.9.8", "dexie": "^2.0.0", "dompurify": "^2.3.3", diff --git a/app/src/main-process/app-window.ts b/app/src/main-process/app-window.ts index 40c34459459..5d033675304 100644 --- a/app/src/main-process/app-window.ts +++ b/app/src/main-process/app-window.ts @@ -21,7 +21,10 @@ import * as path from 'path' import windowStateKeeper from 'electron-window-state' import * as ipcMain from './ipc-main' import * as ipcWebContents from './ipc-webcontents' -import { installNotificationCallback } from './notifications' +import { + installNotificationCallback, + terminateDesktopNotifications, +} from './notifications' export class AppWindow { private window: Electron.BrowserWindow @@ -107,6 +110,7 @@ export class AppWindow { } nativeTheme.removeAllListeners() autoUpdater.removeAllListeners() + terminateDesktopNotifications() }) if (__WIN32__) { diff --git a/app/src/main-process/notifications.ts b/app/src/main-process/notifications.ts index 680575cdc40..98717e04d04 100644 --- a/app/src/main-process/notifications.ts +++ b/app/src/main-process/notifications.ts @@ -1,6 +1,7 @@ import { initializeNotifications, onNotificationEvent, + terminateNotifications, } from 'desktop-notifications' import { BrowserWindow } from 'electron' import { findToastActivatorClsid } from '../lib/find-toast-activator-clsid' @@ -35,6 +36,10 @@ export function initializeDesktopNotifications() { initializeNotifications({ toastActivatorClsid: windowsToastActivatorClsid }) } +export function terminateDesktopNotifications() { + terminateNotifications() +} + export function installNotificationCallback(window: BrowserWindow) { onNotificationEvent((event, id, userInfo) => { ipcWebContents.send( diff --git a/app/yarn.lock b/app/yarn.lock index 2def93e2099..5b0c6db1e3e 100644 --- a/app/yarn.lock +++ b/app/yarn.lock @@ -363,10 +363,10 @@ delegates@^1.0.0: resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= -desktop-notifications@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/desktop-notifications/-/desktop-notifications-0.2.1.tgz#ff934e45ef6b47cfbbd6c596c759fc91b96ab753" - integrity sha512-ssB7SYsWlVgFCN/4KE5QIHM1hH4PXGHmlIYpUa4xR7WDHcjMEU6vrnrAFWx9SnPLVkCNDiWRwSDejlS1VF9BHw== +desktop-notifications@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/desktop-notifications/-/desktop-notifications-0.2.2.tgz#197a32ee504a894ad074793dab285681c533e5ac" + integrity sha512-XMnxdWV6ZfiCzLZNC00n6h30Jt3z8yv21FAPBt/kK6hANI0PaoYWsRKEYya0zMUAX/9lrh429R5OtRGOKWZQSw== dependencies: node-addon-api "^5.0.0" prebuild-install "^7.0.1"