refactor: decompose frontend state and medication dialog flows
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { loadCollapsedDaysFromStorage } from "../../utils/storage";
|
||||
|
||||
export type ScheduleCollapseState = {
|
||||
collapsed: Set<string>;
|
||||
expanded: Set<string>;
|
||||
};
|
||||
|
||||
export function loadScheduleCollapseState(collapseKey: string, expandKey: string): ScheduleCollapseState {
|
||||
return loadCollapsedDaysFromStorage(collapseKey, expandKey);
|
||||
}
|
||||
|
||||
export function saveCollapsedDaySet(storageKey: string, value: Set<string>): void {
|
||||
try {
|
||||
localStorage.setItem(storageKey, JSON.stringify([...value]));
|
||||
} catch {
|
||||
// Ignore storage failures and keep UI responsive.
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user