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
+2
-13
@@ -3,23 +3,12 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import appSemanticVersionInjectable from "../../vars/app-semantic-version.injectable";
|
||||
import type { UpdateChannelId } from "../update-channels";
|
||||
import releaseChannelInjectable from "../../vars/release-channel.injectable";
|
||||
import { updateChannels } from "../update-channels";
|
||||
|
||||
const defaultUpdateChannelInjectable = getInjectable({
|
||||
id: "default-update-channel",
|
||||
|
||||
instantiate: (di) => {
|
||||
const appSemanticVersion = di.inject(appSemanticVersionInjectable);
|
||||
const currentReleaseChannel = appSemanticVersion.prerelease[0]?.toString();
|
||||
|
||||
if (currentReleaseChannel in updateChannels) {
|
||||
return updateChannels[currentReleaseChannel as UpdateChannelId];
|
||||
}
|
||||
|
||||
return updateChannels.latest;
|
||||
},
|
||||
instantiate: (di) => updateChannels[di.inject(releaseChannelInjectable)],
|
||||
});
|
||||
|
||||
export default defaultUpdateChannelInjectable;
|
||||
Reference in new issue
Block a user