mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
add user-store file name migration (#733)
Co-authored-by: Sebastian Malton <smalton@mirantis.com>
This commit is contained in:
1 parent
62c3501011
commit
0b99377feb
3 files changed
+39
-1
No files matched your search
@@ -10,6 +10,7 @@ import { kubeConfigDefaultPath, loadConfig } from "./kube-helpers";
|
||||
import { appEventBus } from "./event-bus";
|
||||
import logger from "../main/logger";
|
||||
import path from "path";
|
||||
import { fileNameMigration } from "../migrations/user-store";
|
||||
|
||||
export interface UserStoreModel {
|
||||
kubeConfigPath: string;
|
||||
@@ -37,7 +38,7 @@ export class UserStore extends BaseStore<UserStoreModel> {
|
||||
|
||||
private constructor() {
|
||||
super({
|
||||
// configName: "lens-user-store", // todo: migrate from default "config.json"
|
||||
configName: "lens-user-store",
|
||||
migrations,
|
||||
});
|
||||
|
||||
@@ -85,6 +86,16 @@ export class UserStore extends BaseStore<UserStoreModel> {
|
||||
}
|
||||
}
|
||||
|
||||
async load(): Promise<void> {
|
||||
/**
|
||||
* This has to be here before the call to `new Config` in `super.load()`
|
||||
* as we have to make sure that file is in the expected place for that call
|
||||
*/
|
||||
await fileNameMigration();
|
||||
|
||||
return super.load();
|
||||
}
|
||||
|
||||
get isNewVersion() {
|
||||
return semver.gt(getAppVersion(), this.lastSeenAppVersion);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user