From a5e1cc9c776fb44ad1c52768ea73bdeaffae4dec Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Thu, 10 Oct 2024 22:32:15 -0400 Subject: [PATCH] Prevent the app from downgrading when a user installs beta over latest (#1014) --- emain/updater.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emain/updater.ts b/emain/updater.ts index d68ff1752..22d737c29 100644 --- a/emain/updater.ts +++ b/emain/updater.ts @@ -23,7 +23,8 @@ function getUpdateChannel(settings: SettingsType): string { let retVal = settingsChannel; // If the user setting doesn't exist yet, set it to the value of the updater config. - if (!settingsChannel) { + // If the user was previously on the `latest` channel and has downloaded a `beta` version, update their configured channel to `beta` to prevent downgrading. + if (!settingsChannel || (settingsChannel == "latest" && updaterChannel == "beta")) { console.log("Update channel setting does not exist, setting to value from updater config."); RpcApi.SetConfigCommand(ElectronWshClient, { "autoupdate:channel": updaterChannel }); retVal = updaterChannel;