From 9368a242ce3c670082a8139dae1f7245af36e0ce Mon Sep 17 00:00:00 2001 From: Zane <75694352+zanesq@users.noreply.github.com> Date: Fri, 13 Jun 2025 09:44:17 -0700 Subject: [PATCH] Check for UPDATES_ENABLED flag before running update logic or in ui (#2897) --- .../src/components/settings/app/AppSettingsSection.tsx | 9 ++++++--- ui/desktop/src/main.ts | 3 ++- ui/desktop/src/updates.ts | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 ui/desktop/src/updates.ts diff --git a/ui/desktop/src/components/settings/app/AppSettingsSection.tsx b/ui/desktop/src/components/settings/app/AppSettingsSection.tsx index d2e3c222..a586fd71 100644 --- a/ui/desktop/src/components/settings/app/AppSettingsSection.tsx +++ b/ui/desktop/src/components/settings/app/AppSettingsSection.tsx @@ -1,6 +1,7 @@ import { useState, useEffect, useRef } from 'react'; import { Switch } from '../../ui/switch'; import UpdateSection from './UpdateSection'; +import { UPDATES_ENABLED } from '../../../updates'; interface AppSettingsSectionProps { scrollToSection?: string; @@ -124,9 +125,11 @@ export default function AppSettingsSection({ scrollToSection }: AppSettingsSecti {/* Update Section */} -
- -
+ {UPDATES_ENABLED && ( +
+ +
+ )} ); diff --git a/ui/desktop/src/main.ts b/ui/desktop/src/main.ts index 831a977c..64be6e50 100644 --- a/ui/desktop/src/main.ts +++ b/ui/desktop/src/main.ts @@ -41,6 +41,7 @@ import { updateTrayMenu, getUpdateAvailable, } from './utils/autoUpdater'; +import { UPDATES_ENABLED } from './updates'; // Define temp directory for pasted images const gooseTempDir = path.join(app.getPath('temp'), 'goose-pasted-images'); @@ -1157,7 +1158,7 @@ const registerGlobalHotkey = (accelerator: string) => { app.whenReady().then(async () => { // Setup auto-updater - setupAutoUpdater(); + UPDATES_ENABLED && setupAutoUpdater(); // Add CSP headers to all sessions session.defaultSession.webRequest.onHeadersReceived((details, callback) => { diff --git a/ui/desktop/src/updates.ts b/ui/desktop/src/updates.ts new file mode 100644 index 00000000..da6e19cf --- /dev/null +++ b/ui/desktop/src/updates.ts @@ -0,0 +1 @@ +export const UPDATES_ENABLED = true;