diff --git a/src/renderer/themes/setup-apply-active-theme.injectable.ts b/src/renderer/themes/setup-apply-active-theme.injectable.ts index ee8444a0b7..17b2e655a5 100644 --- a/src/renderer/themes/setup-apply-active-theme.injectable.ts +++ b/src/renderer/themes/setup-apply-active-theme.injectable.ts @@ -6,29 +6,31 @@ import { getInjectable } from "@ogre-tools/injectable"; import { reaction } from "mobx"; import initializeSystemThemeTypeInjectable from "../../features/theme/system-type/renderer/initialize.injectable"; import { beforeFrameStartsInjectionToken } from "../before-frame-starts/tokens"; +import initUserStoreInjectable from "../stores/init-user-store.injectable"; import activeThemeInjectable from "./active.injectable"; import applyLensThemeInjectable from "./apply-lens-theme.injectable"; const setupApplyActiveThemeInjectable = getInjectable({ id: "setup-apply-active-theme", - instantiate: (di) => { - const activeTheme = di.inject(activeThemeInjectable); - const applyLensTheme = di.inject(applyLensThemeInjectable); + instantiate: (di) => ({ + id: "setup-apply-active-theme", + run: () => { + const activeTheme = di.inject(activeThemeInjectable); + const applyLensTheme = di.inject(applyLensThemeInjectable); - return { - id: "setup-apply-active-theme", - run: () => { - reaction( - () => activeTheme.get(), - applyLensTheme, - { - fireImmediately: true, - }, - ); - }, - runAfter: di.inject(initializeSystemThemeTypeInjectable), - }; - }, + reaction( + () => activeTheme.get(), + applyLensTheme, + { + fireImmediately: true, + }, + ); + }, + runAfter: [ + di.inject(initializeSystemThemeTypeInjectable), + di.inject(initUserStoreInjectable), + ], + }), injectionToken: beforeFrameStartsInjectionToken, });