1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/renderer/stores/init-user-store.injectable.ts
Sebastian Malton 8c6999bd60 Make UserStore loading seperate from creation to fix initialization timing errors
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2022-09-19 10:54:15 -04:00

24 lines
884 B
TypeScript

/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import userStoreInjectable from "../../common/user-store/user-store.injectable";
import { beforeFrameStartsInjectionToken } from "../before-frame-starts/before-frame-starts-injection-token";
import initDefaultUpdateChannelInjectableInjectable from "../vars/default-update-channel/init.injectable";
const initUserStoreInjectable = getInjectable({
id: "init-user-store",
instantiate: (di) => {
const userStore = di.inject(userStoreInjectable);
return {
run: () => userStore.load(),
runAfter: di.inject(initDefaultUpdateChannelInjectableInjectable),
};
},
injectionToken: beforeFrameStartsInjectionToken,
});
export default initUserStoreInjectable;