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

Fix ordering of runnable and order of injection

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-12-05 13:43:00 -05:00
parent 7c221112a0
commit 83bb5c37d9

View File

@ -6,18 +6,18 @@ import { getInjectable } from "@ogre-tools/injectable";
import { reaction } from "mobx"; import { reaction } from "mobx";
import initializeSystemThemeTypeInjectable from "../../features/theme/system-type/renderer/initialize.injectable"; import initializeSystemThemeTypeInjectable from "../../features/theme/system-type/renderer/initialize.injectable";
import { beforeFrameStartsInjectionToken } from "../before-frame-starts/tokens"; import { beforeFrameStartsInjectionToken } from "../before-frame-starts/tokens";
import initUserStoreInjectable from "../stores/init-user-store.injectable";
import activeThemeInjectable from "./active.injectable"; import activeThemeInjectable from "./active.injectable";
import applyLensThemeInjectable from "./apply-lens-theme.injectable"; import applyLensThemeInjectable from "./apply-lens-theme.injectable";
const setupApplyActiveThemeInjectable = getInjectable({ const setupApplyActiveThemeInjectable = getInjectable({
id: "setup-apply-active-theme", id: "setup-apply-active-theme",
instantiate: (di) => { instantiate: (di) => ({
id: "setup-apply-active-theme",
run: () => {
const activeTheme = di.inject(activeThemeInjectable); const activeTheme = di.inject(activeThemeInjectable);
const applyLensTheme = di.inject(applyLensThemeInjectable); const applyLensTheme = di.inject(applyLensThemeInjectable);
return {
id: "setup-apply-active-theme",
run: () => {
reaction( reaction(
() => activeTheme.get(), () => activeTheme.get(),
applyLensTheme, applyLensTheme,
@ -26,9 +26,11 @@ const setupApplyActiveThemeInjectable = getInjectable({
}, },
); );
}, },
runAfter: di.inject(initializeSystemThemeTypeInjectable), runAfter: [
}; di.inject(initializeSystemThemeTypeInjectable),
}, di.inject(initUserStoreInjectable),
],
}),
injectionToken: beforeFrameStartsInjectionToken, injectionToken: beforeFrameStartsInjectionToken,
}); });