Skip to content

Commit 6f8671f

Browse files
committed
v3.1.12. Fix for some windows version not supporting enhanced notifications
1 parent 3a2f6d3 commit 6f8671f

4 files changed

Lines changed: 13 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wavebox",
3-
"version": "3.1.11",
3+
"version": "3.1.12",
44
"description": "Wavebox",
55
"scripts": {
66
"rebuild:electron": "electron-rebuild -f -m src/app -v 1.7.3 -t prod,optional",

src/scenes/mailboxes/src/Notifications/EnhancedNotificationRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import NotificationRendererUtils from './NotificationRendererUtils'
22
import EnhancedNotificationWindowLinux from './EnhancedNotificationWindowLinux'
33
import { DEFAULT_NOTIFICATION_SOUND } from 'shared/Notifications'
4+
import Win32Notification from './Win32NotificationLossy'
45

56
const pkg = window.appPackage()
67
const MacNotification = process.platform === 'darwin' ? window.appNodeModulesRequire('node-mac-notifier') : null
7-
const Win32Notification = process.platform === 'win32' ? window.appNodeModulesRequire('electron-windows-notifications') : null
88

99
class EnhancedNotificationRenderer {
1010
/* **************************************************************************/

src/scenes/mailboxes/src/Notifications/NotificationPlatformSupport.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import OSSettings from 'shared/Models/Settings/OSSettings'
2+
import Win32Notification from './Win32NotificationLossy'
23
const os = window.nativeRequire('os')
34

45
class NotificationPlatformSupport {
@@ -9,7 +10,7 @@ class NotificationPlatformSupport {
910
get enhancedSupportDarwin () { return process.platform === 'darwin' }
1011
get enhancedSupportLinux () { return process.platform === 'linux' }
1112
get enhancedSupportWin32 () {
12-
if (process.platform === 'win32') {
13+
if (process.platform === 'win32' && Win32Notification) {
1314
const major = parseInt(os.release().split('.')[0])
1415
return major >= 10
1516
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
if (process.platform === 'win32') {
2+
try {
3+
module.exports = window.appNodeModulesRequire('electron-windows-notifications')
4+
} catch (ex) {
5+
module.exports = null
6+
}
7+
} else {
8+
module.exports = null
9+
}

0 commit comments

Comments
 (0)