fix: unify stock semantics across planner and scheduler (#245)

* fix: unify stock semantics across planner and scheduler

* fix: stabilize dashboard hmr and align stock helper tests
This commit is contained in:
Daniel Volz
2026-02-21 15:24:53 +01:00
committed by GitHub
parent 02af93ec55
commit 612aa007aa
14 changed files with 846 additions and 285 deletions
+11 -1
View File
@@ -212,7 +212,17 @@ export interface AppContextValue {
// Context
// =============================================================================
const AppContext = createContext<AppContextValue | null>(null);
const APP_CONTEXT_SINGLETON_KEY = "__MEDASSIST_APP_CONTEXT_SINGLETON__";
const AppContext = (() => {
const globalRef = globalThis as typeof globalThis & {
[APP_CONTEXT_SINGLETON_KEY]?: React.Context<AppContextValue | null>;
};
if (!globalRef[APP_CONTEXT_SINGLETON_KEY]) {
globalRef[APP_CONTEXT_SINGLETON_KEY] = createContext<AppContextValue | null>(null);
}
return globalRef[APP_CONTEXT_SINGLETON_KEY];
})();
// Helper for user-specific localStorage keys
function userStorageKey(userId: number | undefined, key: string): string {