forked from jappel/leistungsbilanz-ts
Show circuit protection in saved layouts
This commit is contained in:
parent
f4bfef9071
commit
2964205a27
3 changed files with 87 additions and 7 deletions
|
|
@ -30,8 +30,10 @@ import {
|
|||
formatPhaseTypeLabel,
|
||||
formatValue,
|
||||
getCircuitSectionLabel,
|
||||
getLegacyProjectColumnLayoutStorageKey,
|
||||
getProjectColumnLayoutStorageKey,
|
||||
isGridEditorControlTarget,
|
||||
migrateLegacyColumnLayout,
|
||||
normalizeColumnOrder,
|
||||
parseStoredColumnLayout,
|
||||
} from "../utils/circuit-grid-model";
|
||||
|
|
@ -374,14 +376,23 @@ export function CircuitTreeEditor(props: { projectId: string; circuitListId: str
|
|||
setColumnOrder(allColumns.map((column) => column.key));
|
||||
setVisibleColumnKeys(defaultVisibleColumnKeys);
|
||||
try {
|
||||
const parsed = parseStoredColumnLayout(
|
||||
localStorage.getItem(
|
||||
getProjectColumnLayoutStorageKey(projectId)
|
||||
) ??
|
||||
localStorage.getItem(
|
||||
LEGACY_COLUMN_LAYOUT_STORAGE_KEY
|
||||
)
|
||||
const currentLayout = parseStoredColumnLayout(
|
||||
localStorage.getItem(getProjectColumnLayoutStorageKey(projectId))
|
||||
);
|
||||
const legacyLayout =
|
||||
parseStoredColumnLayout(
|
||||
localStorage.getItem(
|
||||
getLegacyProjectColumnLayoutStorageKey(projectId)
|
||||
)
|
||||
) ??
|
||||
parseStoredColumnLayout(
|
||||
localStorage.getItem(LEGACY_COLUMN_LAYOUT_STORAGE_KEY)
|
||||
);
|
||||
const parsed =
|
||||
currentLayout ??
|
||||
(legacyLayout
|
||||
? migrateLegacyColumnLayout(legacyLayout)
|
||||
: null);
|
||||
if (!parsed) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue