Catch electron exception
This commit is contained in:
parent
fac539c102
commit
02e85fcffb
1 changed files with 12 additions and 3 deletions
|
@ -37,9 +37,18 @@ if (window && window.process && window.process && window.process.type === 'rende
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class ElectronPlatform extends BasePlatform {
|
export default class ElectronPlatform extends BasePlatform {
|
||||||
setNotificationCount(count: number) {
|
// this sometimes throws because electron is made of fail:
|
||||||
super.setNotificationCount(count);
|
// https://github.com/electron/electron/issues/7351
|
||||||
remote.app.setBadgeCount(count);
|
// For now, let's catch the error, but I suspect it may
|
||||||
|
// continue to fail and we might just have to accept that
|
||||||
|
// electron's remote RPC is a non-starter for now and use IPC
|
||||||
|
try {
|
||||||
|
setNotificationCount(count: number) {
|
||||||
|
super.setNotificationCount(count);
|
||||||
|
remote.app.setBadgeCount(count);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Failed to set notification count", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
displayNotification(title: string, msg: string, avatarUrl: string): Notification {
|
displayNotification(title: string, msg: string, avatarUrl: string): Notification {
|
||||||
|
|
Loading…
Add table
Reference in a new issue