Fix auto-updater

This commit is contained in:
Geomitron
2023-12-29 13:38:04 -06:00
parent c86a2e3bb2
commit 28e063e6a1
2 changed files with 7 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ import { UpdateProgress } from '../../src-shared/interfaces/update.interface'
import { emitIpcEvent } from '../main'
let updateAvailable: boolean | null = false
let downloading = false
autoUpdater.autoDownload = false
autoUpdater.logger = null
@@ -49,8 +50,8 @@ export async function getCurrentVersion() {
* Begins the process of downloading the latest update.
*/
export function downloadUpdate() {
if (this.downloading) { return }
this.downloading = true
if (downloading) { return }
downloading = true
autoUpdater.on('download-progress', (updateProgress: UpdateProgress) => {
emitIpcEvent('updateProgress', updateProgress)