From 4b8f37485670f6c3b1f9e4df98941ea75d553b4d Mon Sep 17 00:00:00 2001 From: Ryan Cao <70191398+ryanccn@users.noreply.github.com> Date: Sun, 22 Oct 2023 23:10:25 +0800 Subject: [PATCH] feat: allow disabling updates check (#155) Co-authored-by: V --- src/renderer/components/Settings.tsx | 3 ++- src/shared/settings.d.ts | 1 + src/updater/main.ts | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/Settings.tsx b/src/renderer/components/Settings.tsx index 236ff42..e0dcd55 100644 --- a/src/renderer/components/Settings.tsx +++ b/src/renderer/components/Settings.tsx @@ -47,7 +47,8 @@ export default function SettingsUi() { "openLinksWithElectron", "Open Links in app (experimental)", "Opens links in a new Vesktop window instead of your web browser" - ] + ], + ["checkUpdates", "Check for updates", "Automatically check for Vesktop updates", true] ]; const switches = allSwitches.filter(isTruthy); diff --git a/src/shared/settings.d.ts b/src/shared/settings.d.ts index 6ecfe6f..2820a44 100644 --- a/src/shared/settings.d.ts +++ b/src/shared/settings.d.ts @@ -24,6 +24,7 @@ export interface Settings { windowBounds?: Rectangle; disableMinSize?: boolean; + checkUpdates?: boolean; skippedUpdate?: string; firstLaunch?: boolean; diff --git a/src/updater/main.ts b/src/updater/main.ts index ec42217..b84081c 100644 --- a/src/updater/main.ts +++ b/src/updater/main.ts @@ -77,7 +77,8 @@ function isOutdated(oldVersion: string, newVersion: string) { } export async function checkUpdates() { - // if (IS_DEV) return; + if (Settings.store.checkUpdates === false) return; + try { const raw = await githubGet("/repos/Vencord/Vesktop/releases/latest"); const data = JSON.parse(raw.toString("utf-8")) as ReleaseData;