From 37d31d9969df74018fc1140f6bc18984c4db544a Mon Sep 17 00:00:00 2001 From: GamingLiamStudios Date: Mon, 7 Feb 2022 22:43:20 +1100 Subject: [PATCH] remove async in ipc 'check-for-update' --- src/main/base/browserwindow.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/base/browserwindow.ts b/src/main/base/browserwindow.ts index 164c6186..c446e12a 100644 --- a/src/main/base/browserwindow.ts +++ b/src/main/base/browserwindow.ts @@ -563,16 +563,16 @@ export class BrowserWindow { }); }); - ipcMain.on('check-for-update', async (_event) => { + ipcMain.on('check-for-update', (_event) => { console.log('Checking for updates') const branch = utils.getStoreValue('general.update_branch') - let latestbranch = await fetch(`https://circleci.com/api/v1.1/project/gh/ciderapp/Cider/latest/artifacts?branch=${branch}&filter=successful`) + let latestbranch = fetch(`https://circleci.com/api/v1.1/project/gh/ciderapp/Cider/latest/artifacts?branch=${branch}&filter=successful`).then().catch() if (latestbranch.status != 200) { console.log(`Error fetching latest artifact from the **${branch}** branch`) return } - let latestbranchjson = await latestbranch.json() + let latestbranchjson = latestbranch.json().then().catch() console.log('Artifact - ', latestbranchjson[0].url) const options: any = { @@ -584,8 +584,8 @@ export class BrowserWindow { */ const win_autoUpdater = new NsisUpdater(options) //Windows const linux_autoUpdater = new AppImageUpdater(options) //Linux - await win_autoUpdater.checkForUpdatesAndNotify() - await linux_autoUpdater.checkForUpdatesAndNotify() + await win_autoUpdater.checkForUpdatesAndNotify().then().catch() + await linux_autoUpdater.checkForUpdatesAndNotify().then().catch() }) ipcMain.on('share-menu', async (_event, url) => {