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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user