From 46482a7f670baa4e6ad0e3151aa7017c3a742ac4 Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Tue, 6 Aug 2024 14:25:30 -0700 Subject: [PATCH] fix isDev check for auto updater --- emain/updater.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/emain/updater.ts b/emain/updater.ts index 6f6f17afd..a9b335446 100644 --- a/emain/updater.ts +++ b/emain/updater.ts @@ -1,7 +1,7 @@ +import { isDev } from "@/util/isdev"; import * as electron from "electron"; import { autoUpdater } from "electron-updater"; import * as services from "../frontend/app/store/services"; -import { isDev } from "../frontend/util/isdev"; import { fireAndForget } from "../frontend/util/util"; let autoUpdateLock = false; @@ -16,11 +16,6 @@ export class Updater { lastUpdateCheck: Date; constructor() { - if (isDev) { - console.log("skipping auto-updater in dev mode"); - return null; - } - autoUpdater.removeAllListeners(); autoUpdater.on("error", (err) => { @@ -158,6 +153,11 @@ electron.ipcMain.on("get-app-update-status", (event) => { * @param enabled Whether the auto-updater should be enabled */ export async function configureAutoUpdater() { + if (isDev()) { + console.log("skipping auto-updater in dev mode"); + return null; + } + // simple lock to prevent multiple auto-update configuration attempts, this should be very rare if (autoUpdateLock) { console.log("auto-update configuration already in progress, skipping");