diff options
Diffstat (limited to 'gui')
| -rw-r--r-- | gui/src/main/notification-controller.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gui/src/main/notification-controller.ts b/gui/src/main/notification-controller.ts index 4b0f59fbf6..976d0dda4c 100644 --- a/gui/src/main/notification-controller.ts +++ b/gui/src/main/notification-controller.ts @@ -1,4 +1,5 @@ import { app, nativeImage, NativeImage, Notification, shell } from 'electron'; +import os from 'os'; import path from 'path'; import { sprintf } from 'sprintf-js'; import config from '../config.json'; @@ -14,7 +15,16 @@ export default class NotificationController { private notificationIcon?: NativeImage; constructor() { + let usePngIcon; if (process.platform === 'linux') { + usePngIcon = true; + } else if (process.platform === 'win32') { + usePngIcon = parseInt(os.release().split('.')[0], 10) >= 10; + } else { + usePngIcon = false; + } + + if (usePngIcon) { const basePath = path.resolve(path.join(__dirname, '../../assets/images')); this.notificationIcon = nativeImage.createFromPath( path.join(basePath, 'icon-notification.png'), |
