Put try block in the right place
This commit is contained in:
parent
d068499184
commit
cbbbedc0cc
1 changed files with 10 additions and 10 deletions
|
@ -37,18 +37,18 @@ if (window && window.process && window.process && window.process.type === 'rende
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class ElectronPlatform extends BasePlatform {
|
export default class ElectronPlatform extends BasePlatform {
|
||||||
// this sometimes throws because electron is made of fail:
|
setNotificationCount(count: number) {
|
||||||
// https://github.com/electron/electron/issues/7351
|
super.setNotificationCount(count);
|
||||||
// For now, let's catch the error, but I suspect it may
|
// this sometimes throws because electron is made of fail:
|
||||||
// continue to fail and we might just have to accept that
|
// https://github.com/electron/electron/issues/7351
|
||||||
// electron's remote RPC is a non-starter for now and use IPC
|
// For now, let's catch the error, but I suspect it may
|
||||||
try {
|
// continue to fail and we might just have to accept that
|
||||||
setNotificationCount(count: number) {
|
// electron's remote RPC is a non-starter for now and use IPC
|
||||||
super.setNotificationCount(count);
|
try {
|
||||||
remote.app.setBadgeCount(count);
|
remote.app.setBadgeCount(count);
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Failed to set notification count", e);
|
||||||
}
|
}
|
||||||
} 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