Skip to content

Commit cbbbedc

Browse files
committed
Put try block in the right place
1 parent d068499 commit cbbbedc

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/vector/platform/ElectronPlatform.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ if (window && window.process && window.process && window.process.type === 'rende
3737
}
3838

3939
export default class ElectronPlatform extends BasePlatform {
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);
40+
setNotificationCount(count: number) {
41+
super.setNotificationCount(count);
42+
// this sometimes throws because electron is made of fail:
43+
// https://github.com/electron/electron/issues/7351
44+
// For now, let's catch the error, but I suspect it may
45+
// continue to fail and we might just have to accept that
46+
// electron's remote RPC is a non-starter for now and use IPC
47+
try {
4848
remote.app.setBadgeCount(count);
49+
} catch (e) {
50+
console.error("Failed to set notification count", e);
4951
}
50-
} catch (e) {
51-
console.error("Failed to set notification count", e);
5252
}
5353

5454
displayNotification(title: string, msg: string, avatarUrl: string): Notification {

0 commit comments

Comments
 (0)