File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -37,9 +37,18 @@ if (window && window.process && window.process && window.process.type === 'rende
37
37
}
38
38
39
39
export default class ElectronPlatform extends BasePlatform {
40
- setNotificationCount ( count : number ) {
41
- super . setNotificationCount ( count ) ;
42
- remote . app . setBadgeCount ( count ) ;
40
+ // this sometimes throws because electron is made of fail:
41
+ // https://github.com/electron/electron/issues/7351
42
+ // For now, let's catch the error, but I suspect it may
43
+ // continue to fail and we might just have to accept that
44
+ // electron's remote RPC is a non-starter for now and use IPC
45
+ try {
46
+ setNotificationCount ( count : number ) {
47
+ super . setNotificationCount ( count ) ;
48
+ remote . app . setBadgeCount ( count ) ;
49
+ }
50
+ } catch ( e ) {
51
+ console . error ( "Failed to set notification count" , e ) ;
43
52
}
44
53
45
54
displayNotification ( title : string , msg : string , avatarUrl : string ) : Notification {
You can’t perform that action at this time.
0 commit comments