mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix beta->latest->beta upgrade loop (#6189)
This commit is contained in:
1 parent
b428518857
commit
a784ca70b1
8 files changed
+81
-39
No files matched your search
+1
-4
@@ -19,10 +19,7 @@ const checkForUpdatesStartingFromChannelInjectable = getInjectable({
|
||||
id: "check-for-updates-starting-from-channel",
|
||||
|
||||
instantiate: (di) => {
|
||||
const checkForPlatformUpdates = di.inject(
|
||||
checkForPlatformUpdatesInjectable,
|
||||
);
|
||||
|
||||
const checkForPlatformUpdates = di.inject(checkForPlatformUpdatesInjectable);
|
||||
const updateCanBeDowngraded = di.inject(updateCanBeDowngradedInjectable);
|
||||
|
||||
const _recursiveCheck = async (
|
||||
|
||||
+6
-11
@@ -5,24 +5,19 @@
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { computed } from "mobx";
|
||||
import selectedUpdateChannelInjectable from "../../../common/application-update/selected-update-channel/selected-update-channel.injectable";
|
||||
import appVersionInjectable from "../../../common/vars/app-version.injectable";
|
||||
import { SemVer } from "semver";
|
||||
import releaseChannelInjectable from "../../../common/vars/release-channel.injectable";
|
||||
|
||||
const updateCanBeDowngradedInjectable = getInjectable({
|
||||
id: "update-can-be-downgraded",
|
||||
|
||||
instantiate: (di) => {
|
||||
const selectedUpdateChannel = di.inject(selectedUpdateChannelInjectable);
|
||||
const appVersion = di.inject(appVersionInjectable);
|
||||
const releaseChannel = di.inject(releaseChannelInjectable);
|
||||
|
||||
return computed(() => {
|
||||
const semVer = new SemVer(appVersion);
|
||||
|
||||
return (
|
||||
semVer.prerelease[0] !==
|
||||
selectedUpdateChannel.value.get().id
|
||||
);
|
||||
});
|
||||
return computed(() => (
|
||||
selectedUpdateChannel.value.get().id === "latest"
|
||||
&& releaseChannel !== "latest"
|
||||
));
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user