Skip to content

Commit c1fee60

Browse files
committed
fix: address type issues
1 parent b51490e commit c1fee60

3 files changed

Lines changed: 21 additions & 23 deletions

File tree

‎src/io/import/configJson.ts‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { z } from 'zod';
22
import { zodEnumFromObjKeys } from '@/src/utils';
33
import { ACTIONS } from '@/src/constants';
4-
import { Layouts } from '@/src/config';
4+
// import { Layouts } from '@/src/config';
55

66
// for applyConfig
77
import { useRectangleStore } from '@/src/store/tools/rectangles';
88
import { useRulerStore } from '@/src/store/tools/rulers';
99
import { useDataBrowserStore } from '@/src/store/data-browser';
1010
import { usePolygonStore } from '@/src/store/tools/polygons';
11-
import { useViewStore } from '@/src/store/views';
11+
// import { useViewStore } from '@/src/store/views';
1212
import { useWindowingStore } from '@/src/store/view-configs/windowing';
1313
import { actionToKey } from '@/src/composables/useKeyboardShortcuts';
1414
import { useSegmentGroupStore } from '@/src/store/segmentGroups';
@@ -20,7 +20,7 @@ import useLoadDataStore from '@/src/store/load-data';
2020

2121
const layout = z
2222
.object({
23-
activeLayout: zodEnumFromObjKeys(Layouts).optional(),
23+
// activeLayout: zodEnumFromObjKeys(Layouts).optional(),
2424
})
2525
.optional();
2626

@@ -128,12 +128,12 @@ const applySampleData = (manifest: Config) => {
128128
useDataBrowserStore().hideSampleData = !!manifest.dataBrowser?.hideSampleData;
129129
};
130130

131-
const applyLayout = (manifest: Config) => {
132-
if (manifest.layout?.activeLayout) {
133-
const startingLayout = Layouts[manifest.layout.activeLayout];
134-
useViewStore().setLayout(startingLayout);
135-
}
136-
};
131+
// const applyLayout = (manifest: Config) => {
132+
// if (manifest.layout?.activeLayout) {
133+
// const startingLayout = Layouts[manifest.layout.activeLayout];
134+
// useViewStore().setLayout(startingLayout);
135+
// }
136+
// };
137137

138138
const applyShortcuts = (manifest: Config) => {
139139
if (!manifest.shortcuts) return;
@@ -159,7 +159,7 @@ const applyWindowing = (manifest: Config) => {
159159
};
160160

161161
export const applyConfig = (manifest: Config) => {
162-
applyLayout(manifest);
162+
// applyLayout(manifest);
163163
applyLabels(manifest);
164164
applySampleData(manifest);
165165
applyShortcuts(manifest);

‎src/io/import/processors/restoreStateFile.ts‎

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import { DataSource } from '@/src/io/import/dataSource';
1414
import { MANIFEST, isStateFile } from '@/src/io/state-file';
1515
import { partition } from '@/src/utils';
1616
import { pipe } from '@/src/utils/functional';
17-
import { useViewStore } from '@/src/store/views';
18-
import { useDatasetStore } from '@/src/store/datasets';
1917
import {
2018
makeDefaultSegmentGroupName,
2119
useSegmentGroupStore,
@@ -366,9 +364,9 @@ const restoreStateFile: ImportHandler = async (dataSource, context) => {
366364
);
367365
}
368366

369-
// We restore the view first, so that the appropriate watchers are triggered
370-
// in the views as the data is loaded
371-
useViewStore().setLayout(manifest.layout);
367+
// // We restore the view first, so that the appropriate watchers are triggered
368+
// // in the views as the data is loaded
369+
// useViewStore().setLayout(manifest.layout);
372370

373371
const stateIDToStoreID = await restoreDatasets(
374372
manifest,
@@ -377,14 +375,14 @@ const restoreStateFile: ImportHandler = async (dataSource, context) => {
377375
);
378376

379377
// Restore the primary selection
380-
if (manifest.primarySelection !== undefined) {
381-
const selectedID = stateIDToStoreID[manifest.primarySelection];
378+
// if (manifest.primarySelection !== undefined) {
379+
// const selectedID = stateIDToStoreID[manifest.primarySelection];
382380

383-
useDatasetStore().setPrimarySelection(selectedID);
384-
}
381+
// useDatasetStore().setPrimarySelection(selectedID);
382+
// }
385383

386384
// Restore the views
387-
useViewStore().deserialize(manifest.views, stateIDToStoreID);
385+
// useViewStore().deserialize(manifest.views, stateIDToStoreID);
388386

389387
// Restore the labelmaps
390388
const segmentGroupIDMap = await useSegmentGroupStore().deserialize(

‎src/io/state-file/index.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useSegmentGroupStore } from '@/src/store/segmentGroups';
44
import { useLayersStore } from '@/src/store/datasets-layers';
55
import { useToolStore } from '@/src/store/tools';
66
import { Tools } from '@/src/store/tools/types';
7-
import { useViewStore } from '@/src/store/views';
7+
// import { useViewStore } from '@/src/store/views';
88
import { Manifest } from './schema';
99

1010
import { retypeFile } from '../io';
@@ -15,7 +15,7 @@ export const MANIFEST_VERSION = '5.0.1';
1515

1616
export async function serialize() {
1717
const datasetStore = useDatasetStore();
18-
const viewStore = useViewStore();
18+
// const viewStore = useViewStore();
1919
const labelStore = useSegmentGroupStore();
2020
const toolStore = useToolStore();
2121
const layersStore = useLayersStore();
@@ -53,7 +53,7 @@ export async function serialize() {
5353
};
5454

5555
await datasetStore.serialize(stateFile);
56-
viewStore.serialize(stateFile);
56+
// viewStore.serialize(stateFile);
5757
await labelStore.serialize(stateFile);
5858
toolStore.serialize(stateFile);
5959
await layersStore.serialize(stateFile);

0 commit comments

Comments
 (0)