Skip to content

Commit

Permalink
fix: add update check to bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
daretodave committed Apr 27, 2024
1 parent eb3a4f9 commit 6832a5c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/main/bootstrap/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { ErrorModal } from '../window/windows/error-modal'
import { createTray } from './create-tray'
import { createShortcut } from './create-shortcut'
import { attach } from '../framework/runtime-events'
import { RunnerWindow } from '../window/windows/runner'
import { autoUpdater } from 'electron-updater'

export interface BootstrapContext {
app: App
Expand All @@ -33,6 +35,12 @@ export async function boostrap(context: BootstrapContext): Promise<void> {
app.quit()
}
})
app.on('ready', function () {
autoUpdater
.checkForUpdatesAndNotify()
.then((r) => console.log(r))
.catch(console.error)
})

attach(context)

Expand All @@ -48,7 +56,11 @@ export async function boostrap(context: BootstrapContext): Promise<void> {
app.on('activate', async function () {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) await createWindows(context)
if (BrowserWindow.getAllWindows().length === 0) {
await createWindows(context)
} else {
workspace.show(RunnerWindow)
}
})

await workspace.commands.load()
Expand Down

0 comments on commit 6832a5c

Please sign in to comment.