diff --git a/desktop/.flowconfig b/desktop/.flowconfig --- a/desktop/.flowconfig +++ b/desktop/.flowconfig @@ -19,6 +19,7 @@ deprecated-type=warn unsafe-getters-setters=warn unnecessary-invariant=warn +unused-promise=error [strict] deprecated-type diff --git a/desktop/src/main.js b/desktop/src/main.js --- a/desktop/src/main.js +++ b/desktop/src/main.js @@ -176,17 +176,17 @@ }); win.webContents.setWindowOpenHandler(({ url: openURL }) => { - shell.openExternal(openURL); + void shell.openExternal(openURL); // Returning 'deny' prevents a new electron window from being created return { action: 'deny' }; }); - (async () => { + void (async () => { const css = await scrollbarCSS; - win.webContents.insertCSS(css); + await win.webContents.insertCSS(css); })(); - win.loadURL(url + (urlPath ?? '')); + void win.loadURL(url + (urlPath ?? '')); mainWindow = win; return win; @@ -202,7 +202,7 @@ center: true, backgroundColor: '#111827', }); - win.loadFile(path.resolve(__dirname, '../pages/splash.html')); + void win.loadFile(path.resolve(__dirname, '../pages/splash.html')); return win; }; @@ -221,7 +221,7 @@ win.on('close', () => { app.quit(); }); - win.loadFile(path.resolve(__dirname, '../pages/error.html')); + void win.loadFile(path.resolve(__dirname, '../pages/error.html')); return win; }; @@ -252,7 +252,7 @@ setTimeout(() => { loadedSuccessfully = true; - main.loadURL(url); + void main.loadURL(url); }, 1000); }; @@ -272,7 +272,7 @@ main.show(); if (app.isPackaged) { - sendDeviceTokenToWebApp(); + void sendDeviceTokenToWebApp(); } } }); @@ -289,7 +289,7 @@ } setApplicationMenu(); - (async () => { + void (async () => { await app.whenReady(); const handleNotificationClick = (threadID?: string) => { diff --git a/desktop/src/push-notifications.js b/desktop/src/push-notifications.js --- a/desktop/src/push-notifications.js +++ b/desktop/src/push-notifications.js @@ -14,7 +14,7 @@ let windowsPushNotificationManager; const windowsPushNotifEventEmitter = new EventEmitter(); if (process.platform === 'win32' && app.isPackaged && isNormalStartup()) { - (async () => { + void (async () => { try { const { PushNotificationManager } = await import('@commapp/windowspush');