From 21fbc54595b0b3585c5295a891882f8ad063d82e Mon Sep 17 00:00:00 2001 From: GamingLiamStudios Date: Mon, 7 Feb 2022 23:09:48 +1100 Subject: [PATCH] semicolon --- src/main/base/browserwindow.ts | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/main/base/browserwindow.ts b/src/main/base/browserwindow.ts index e2968293..0f5cc617 100644 --- a/src/main/base/browserwindow.ts +++ b/src/main/base/browserwindow.ts @@ -563,34 +563,30 @@ export class BrowserWindow { }); }); - ipcMain.on('check-for-update', (_event) => { + ipcMain.on('check-for-update', async (_event) => { console.log('Checking for updates') - /* const branch = utils.getStoreValue('general.update_branch') - let latestbranch = fetch(`https://circleci.com/api/v1.1/project/gh/ciderapp/Cider/latest/artifacts?branch=${branch}&filter=successful`).then().catch() + let latestbranch = await fetch(`https://circleci.com/api/v1.1/project/gh/ciderapp/Cider/latest/artifacts?branch=${branch}&filter=successful`) if (latestbranch.status != 200) { console.log(`Error fetching latest artifact from the **${branch}** branch`) return } - let latestbranchjson = latestbranch.json().then().catch() + let latestbranchjson = await latestbranch.json() console.log('Artifact - ', latestbranchjson[0].url) const options: any = { provider: 'generic', url: 'https://43-429851205-gh.circle-artifacts.com/0/%7E/Cider/dist/artifacts' //Base URL } - */ /* * Have to handle the auto updaters seperatly until we can support macOS. electron-builder limitation -q */ - /* - const win_autoUpdater = new NsisUpdater(options) //Windows - const linux_autoUpdater = new AppImageUpdater(options) //Linux - win_autoUpdater.checkForUpdatesAndNotify().then().catch() - linux_autoUpdater.checkForUpdatesAndNotify().then().catch() - */ - }) + const win_autoUpdater = new NsisUpdater(options) //Windows + const linux_autoUpdater = new AppImageUpdater(options) //Linux + await win_autoUpdater.checkForUpdatesAndNotify() + await linux_autoUpdater.checkForUpdatesAndNotify() + }); ipcMain.on('share-menu', async (_event, url) => { if (process.platform != 'darwin') return;