mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Only offer app version downgrade if updateChannel differs from current version (#4212)
This commit is contained in:
parent
dec043f3f2
commit
7ba359be03
@ -107,7 +107,9 @@ export class UserStore extends BaseStore<UserStoreModel> /* implements UserStore
|
|||||||
return this.shell || process.env.SHELL || process.env.PTYSHELL;
|
return this.shell || process.env.SHELL || process.env.PTYSHELL;
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly isAllowedToDowngrade = new SemVer(getAppVersion()).prerelease[0] !== "latest";
|
@computed get isAllowedToDowngrade() {
|
||||||
|
return new SemVer(getAppVersion()).prerelease[0] !== this.updateChannel;
|
||||||
|
}
|
||||||
|
|
||||||
startMainReactions() {
|
startMainReactions() {
|
||||||
// track telemetry availability
|
// track telemetry availability
|
||||||
|
|||||||
@ -131,9 +131,13 @@ export const startUpdateChecking = once(function (interval = 1000 * 60 * 60 * 24
|
|||||||
});
|
});
|
||||||
|
|
||||||
export async function checkForUpdates(): Promise<void> {
|
export async function checkForUpdates(): Promise<void> {
|
||||||
|
const userStore = UserStore.getInstance();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
logger.info(`📡 Checking for app updates`);
|
logger.info(`📡 Checking for app updates`);
|
||||||
|
|
||||||
|
autoUpdater.channel = userStore.updateChannel;
|
||||||
|
autoUpdater.allowDowngrade = userStore.isAllowedToDowngrade;
|
||||||
await autoUpdater.checkForUpdates();
|
await autoUpdater.checkForUpdates();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error(`${AutoUpdateLogPrefix}: failed with an error`, { error: String(error) });
|
logger.error(`${AutoUpdateLogPrefix}: failed with an error`, { error: String(error) });
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user