1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Use multiple runAfter support to fix crash on renderer

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-12-01 09:17:33 -05:00
parent 5b80dfc70a
commit ed99f24420

View File

@ -4,20 +4,25 @@
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import userStoreInjectable from "../../common/user-store/user-store.injectable"; import userStoreInjectable from "../../common/user-store/user-store.injectable";
import setupAppPathsInjectable from "../app-paths/setup-app-paths.injectable";
import { beforeFrameStartsInjectionToken } from "../before-frame-starts/before-frame-starts-injection-token"; import { beforeFrameStartsInjectionToken } from "../before-frame-starts/before-frame-starts-injection-token";
import initDefaultUpdateChannelInjectable from "../vars/default-update-channel/init.injectable"; import initDefaultUpdateChannelInjectable from "../vars/default-update-channel/init.injectable";
const initUserStoreInjectable = getInjectable({ const initUserStoreInjectable = getInjectable({
id: "init-user-store", id: "init-user-store",
instantiate: (di) => { instantiate: (di) => ({
const userStore = di.inject(userStoreInjectable); id: "init-user-store",
run: () => {
// This must be done here so as to actually only be instantiated after the dependencies are
const userStore = di.inject(userStoreInjectable);
return { return userStore.load();
id: "init-user-store", },
run: () => userStore.load(), runAfter: [
runAfter: di.inject(initDefaultUpdateChannelInjectable), di.inject(initDefaultUpdateChannelInjectable),
}; di.inject(setupAppPathsInjectable),
}, ],
}),
injectionToken: beforeFrameStartsInjectionToken, injectionToken: beforeFrameStartsInjectionToken,
}); });