mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix subclasses of BaseStore<T> not be able to overrride cwd() (#5307)
- The cwd field was being overridden unconditionally by the new getConfigurationFileModelInjectable Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
dbdde19222
commit
05be7f6296
2 files changed
+4
-14
No files matched your search
@@ -5,21 +5,10 @@
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import Config from "conf";
|
||||
import type { BaseStoreParams } from "../base-store";
|
||||
import appVersionInjectable from "./app-version/app-version.injectable";
|
||||
import directoryForUserDataInjectable from "../app-paths/directory-for-user-data/directory-for-user-data.injectable";
|
||||
|
||||
const getConfigurationFileModelInjectable = getInjectable({
|
||||
id: "get-configuration-file-model",
|
||||
instantiate:
|
||||
(di) =>
|
||||
<ConfigurationContent>(content: BaseStoreParams<ConfigurationContent>) =>
|
||||
new Config({
|
||||
...content,
|
||||
projectName: "lens",
|
||||
projectVersion: di.inject(appVersionInjectable),
|
||||
cwd: di.inject(directoryForUserDataInjectable),
|
||||
}),
|
||||
|
||||
instantiate: () => <ConfigurationContent>(content: BaseStoreParams<ConfigurationContent>) => new Config(content),
|
||||
causesSideEffects: true,
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user