(store: DisplayStore, project: string)
| 373 | * eingestellt hat, soll die Galaxie sehen, fuer die dieses Panel gebaut ist. |
| 374 | */ |
| 375 | export function loadDisplaySettings(store: DisplayStore, project: string): GraphDisplaySettings { |
| 376 | if (project.length === 0) { |
| 377 | return { ...DEFAULT_GRAPH_DISPLAY }; |
| 378 | } |
| 379 | let raw: string | null; |
| 380 | try { |
| 381 | raw = store.getItem(displayKey(project)); |
| 382 | } catch { |
| 383 | return { ...DEFAULT_GRAPH_DISPLAY }; |
| 384 | } |
| 385 | if (raw === null) { |
| 386 | return { ...DEFAULT_GRAPH_DISPLAY }; |
| 387 | } |
| 388 | try { |
| 389 | return clampDisplaySettings(JSON.parse(raw)); |
| 390 | } catch { |
| 391 | return { ...DEFAULT_GRAPH_DISPLAY }; |
| 392 | } |
| 393 | } |
| 394 | |
| 395 | /** Die Wahl speichern. Liefert, was jetzt gilt. */ |
| 396 | export function saveDisplaySettings( |
no test coverage detected