Prevent the app from downgrading when a user installs beta over latest (#1014)

This commit is contained in:
Evan Simkowitz 2024-10-10 22:32:15 -04:00 committed by GitHub
parent 666f4112b1
commit a5e1cc9c77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,7 +23,8 @@ function getUpdateChannel(settings: SettingsType): string {
let retVal = settingsChannel; let retVal = settingsChannel;
// If the user setting doesn't exist yet, set it to the value of the updater config. // 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."); console.log("Update channel setting does not exist, setting to value from updater config.");
RpcApi.SetConfigCommand(ElectronWshClient, { "autoupdate:channel": updaterChannel }); RpcApi.SetConfigCommand(ElectronWshClient, { "autoupdate:channel": updaterChannel });
retVal = updaterChannel; retVal = updaterChannel;