feat: allow disabling updates check

This commit is contained in:
Ryan Cao 2023-10-22 13:10:44 +08:00
parent 43ca479fc8
commit 495ae8d24b
No known key found for this signature in database
4 changed files with 6 additions and 2 deletions

View file

@ -48,6 +48,7 @@ export function createFirstLaunchTour() {
Settings.store.discordBranch = data.discordBranch;
Settings.store.firstLaunch = false;
Settings.store.arRPC = data.richPresence;
Settings.store.checkUpdates = true;
if (data.autoStart) autoStart.enable();

View file

@ -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 updates", true]
];
const switches = allSwitches.filter(isTruthy);

View file

@ -24,6 +24,7 @@ export interface Settings {
windowBounds?: Rectangle;
disableMinSize?: boolean;
checkUpdates?: boolean;
skippedUpdate?: string;
firstLaunch?: boolean;

View file

@ -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;