()
| 150 | |
| 151 | /** Ensures the default model exists in localStorage. Returns its ID. */ |
| 152 | export function ensureDefaultModel(): string { |
| 153 | if (typeof window === "undefined") return DEFAULT_GRAPH_MODEL_ID; |
| 154 | const models = loadModels(); |
| 155 | if (!models.find((m) => m.id === DEFAULT_GRAPH_MODEL_ID)) { |
| 156 | saveModels([buildDefaultGraphModel(), ...models]); |
| 157 | } |
| 158 | return DEFAULT_GRAPH_MODEL_ID; |
| 159 | } |
| 160 | |
| 161 | export function getActiveGraphModelId(): string { |
| 162 | if (typeof window === "undefined") return ""; |
no test coverage detected