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:
parent
5b80dfc70a
commit
ed99f24420
@ -4,20 +4,25 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/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 initDefaultUpdateChannelInjectable from "../vars/default-update-channel/init.injectable";
|
||||
|
||||
const initUserStoreInjectable = getInjectable({
|
||||
id: "init-user-store",
|
||||
instantiate: (di) => {
|
||||
const userStore = di.inject(userStoreInjectable);
|
||||
instantiate: (di) => ({
|
||||
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 {
|
||||
id: "init-user-store",
|
||||
run: () => userStore.load(),
|
||||
runAfter: di.inject(initDefaultUpdateChannelInjectable),
|
||||
};
|
||||
},
|
||||
return userStore.load();
|
||||
},
|
||||
runAfter: [
|
||||
di.inject(initDefaultUpdateChannelInjectable),
|
||||
di.inject(setupAppPathsInjectable),
|
||||
],
|
||||
}),
|
||||
injectionToken: beforeFrameStartsInjectionToken,
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user