Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjeannesson authored Mar 14, 2024
2 parents 5419667 + d351cdc commit 1615af9
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions desktop-app/main/background.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EnvironmentStatus } from '@aws-sdk/client-elastic-beanstalk'
import { BrowserWindow, app, autoUpdater, dialog, ipcMain } from 'electron'
import { BrowserWindow, app, ipcMain } from 'electron'
import serve from 'electron-serve'
import {
EB_APP_NAME,
Expand All @@ -25,34 +25,34 @@ if (isProd) {
;(async () => {
await app.whenReady()

if (isProd) {
const server = 'https://hazel-c8oqh794d-napse-investment.vercel.app/'
const url = `${server}/update/${process.platform}/${app.getVersion()}`
// if (isProd) {
// const server = 'https://hazel-c8oqh794d-napse-investment.vercel.app/'
// const url = `${server}/update/${process.platform}/${app.getVersion()}`

autoUpdater.setFeedURL({ url })
setInterval(() => {
autoUpdater.checkForUpdates()
}, 60000)
autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => {
const dialogOpts = {
type: 'info',
buttons: ['Restart', 'Later'],
title: 'Application Update',
message: process.platform === 'win32' ? releaseNotes : releaseName,
detail:
'A new version has been downloaded. Restart the application to apply the updates.'
}
// autoUpdater.setFeedURL({ url })
// setInterval(() => {
// autoUpdater.checkForUpdates()
// }, 60000)
// autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => {
// const dialogOpts = {
// type: 'info',
// buttons: ['Restart', 'Later'],
// title: 'Application Update',
// message: process.platform === 'win32' ? releaseNotes : releaseName,
// detail:
// 'A new version has been downloaded. Restart the application to apply the updates.'
// }

dialog.showMessageBox(dialogOpts).then((returnValue) => {
if (returnValue.response === 0) autoUpdater.quitAndInstall()
})
console.log('update-downloaded')
})
autoUpdater.on('error', (message) => {
console.error('There was a problem updating the application')
console.error(message)
})
}
// dialog.showMessageBox(dialogOpts).then((returnValue) => {
// if (returnValue.response === 0) autoUpdater.quitAndInstall()
// })
// console.log('update-downloaded')
// })
// autoUpdater.on('error', (message) => {
// console.error('There was a problem updating the application')
// console.error(message)
// })
// }

const mainWindow = createWindow('main', {
width: 1000,
Expand Down

0 comments on commit 1615af9

Please sign in to comment.