More unawaited

This commit is contained in:
Manav Rathi 2024-04-30 18:32:34 +05:30
parent 82316ff290
commit bda5226796
No known key found for this signature in database
2 changed files with 9 additions and 9 deletions

View file

@ -202,8 +202,8 @@ const createMainWindow = () => {
app.dock.hide();
});
window.on("show", () => {
if (process.platform == "darwin") app.dock.show();
window.on("show", async () => {
if (process.platform == "darwin") await app.dock.show();
});
// Let ipcRenderer know when mainWindow is in the foreground so that it can
@ -257,7 +257,7 @@ export const allowExternalLinks = (webContents: WebContents) => {
// Returning `action` "deny" accomplishes this.
webContents.setWindowOpenHandler(({ url }) => {
if (!url.startsWith(rendererURL)) {
shell.openExternal(url);
void shell.openExternal(url);
return { action: "deny" };
} else {
return { action: "allow" };
@ -377,7 +377,7 @@ const main = () => {
allowExternalLinks(mainWindow.webContents);
// Start loading the renderer.
mainWindow.loadURL(rendererURL);
void mainWindow.loadURL(rendererURL);
// Continue on with the rest of the startup sequence.
Menu.setApplicationMenu(await createApplicationMenu(mainWindow));
@ -385,8 +385,8 @@ const main = () => {
if (!isDev) setupAutoUpdater(mainWindow);
try {
deleteLegacyDiskCacheDirIfExists();
deleteLegacyKeysStoreIfExists();
await deleteLegacyDiskCacheDirIfExists();
await deleteLegacyKeysStoreIfExists();
} catch (e) {
// Log but otherwise ignore errors during non-critical startup
// actions.

View file

@ -13,7 +13,7 @@ export const setupAutoUpdater = (mainWindow: BrowserWindow) => {
const oneDay = 1 * 24 * 60 * 60 * 1000;
setInterval(() => checkForUpdatesAndNotify(mainWindow), oneDay);
checkForUpdatesAndNotify(mainWindow);
void checkForUpdatesAndNotify(mainWindow);
};
/**
@ -22,7 +22,7 @@ export const setupAutoUpdater = (mainWindow: BrowserWindow) => {
export const forceCheckForAppUpdates = (mainWindow: BrowserWindow) => {
userPreferences.delete("skipAppVersion");
userPreferences.delete("muteUpdateNotificationVersion");
checkForUpdatesAndNotify(mainWindow);
void checkForUpdatesAndNotify(mainWindow);
};
const checkForUpdatesAndNotify = async (mainWindow: BrowserWindow) => {
@ -56,7 +56,7 @@ const checkForUpdatesAndNotify = async (mainWindow: BrowserWindow) => {
mainWindow.webContents.send("appUpdateAvailable", update);
log.debug(() => "Attempting auto update");
autoUpdater.downloadUpdate();
await autoUpdater.downloadUpdate();
let timeoutId: ReturnType<typeof setTimeout>;
const fiveMinutes = 5 * 60 * 1000;