Skip to content

Commit

Permalink
Fix auto-updates on desktop not working since v2.2.2 (#3451)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Jan 11, 2023
1 parent 5c51bd4 commit 0de6e62
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion products/jbrowse-desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"electron": "electron .",
"test": "craco test",
"electron-ts": "yarn tsc --strict --esModuleInterop --skipLibCheck public/electron.ts",
"preelectron": "npm run electron-ts",
"prebuild": "npm run electron-ts",
"predevelop": "npm run electron-ts",
"prepack": "yarn build",
"build": "craco build",
"build-electron": "yarn build && electron-builder build --windows --mac --linux",
Expand Down
14 changes: 8 additions & 6 deletions products/jbrowse-desktop/public/electron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,14 @@ async function createWindow() {
},
})
mainWindowState.manage(mainWindow)

// this ready-to-show handler must be attached before the loadURL
mainWindow.once('ready-to-show', () => {
// unsure how to error handle
// eslint-disable-next-line @typescript-eslint/no-floating-promises
autoUpdater.checkForUpdatesAndNotify()
})

await mainWindow.loadURL(
isDev
? url.format(devServerUrl)
Expand Down Expand Up @@ -331,12 +339,6 @@ async function createWindow() {
mainWindow.on('closed', () => {
mainWindow = null
})

mainWindow.once('ready-to-show', () => {
// unsure how to error handle
// eslint-disable-next-line @typescript-eslint/no-floating-promises
autoUpdater.checkForUpdatesAndNotify()
})
}

function sendStatusToWindow(text: string) {
Expand Down

0 comments on commit 0de6e62

Please sign in to comment.