diff --git a/pyflask/manageNeuroconv/manage_neuroconv.py b/pyflask/manageNeuroconv/manage_neuroconv.py index 6a1bd53b5..d4585b7d7 100644 --- a/pyflask/manageNeuroconv/manage_neuroconv.py +++ b/pyflask/manageNeuroconv/manage_neuroconv.py @@ -1231,6 +1231,8 @@ def get_unit_table_json(interface) -> List[Dict[str, Any]]: unit_column = dict() for property_name in properties: + + # Separate this so that unit_id and unit_name exist (LOOK FURTHER) if property_name == "unit_name": sorting_property_value = str(unit_id) # Insert unit_id as name (str) elif property_name in SORTING_INTERFACE_PROPERTY_OVERRIDES: diff --git a/src/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js b/src/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js index dc5d5fbe4..74e1103c1 100644 --- a/src/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js +++ b/src/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js @@ -289,24 +289,31 @@ export class GuidedPathExpansionPage extends Page { if (existing) source_data[key] = existing ?? {}; } - globalState.results = { - [subject_id]: { - [session_id]: { - source_data, - metadata: { - NWBFile: { - session_id: session_id, - ...(existingMetadata?.NWBFile ?? {}), - }, - Subject: { - subject_id: subject_id, - ...(existingMetadata?.Subject ?? {}), - }, + const sub_id = subject_id ?? ""; + const ses_id = session_id ?? ""; + + // Skip if results already exist without manual IDs + if ((!subject_id || !session_id) && globalState.results) return; + // Otherwise reset the results to the new subject/session + else { + globalState.results = {}; + + globalState.results[sub_id] = {}; + + globalState.results[sub_id][ses_id] = { + source_data, + metadata: { + NWBFile: { + session_id: ses_id, + ...(existingMetadata?.NWBFile ?? {}), + }, + Subject: { + subject_id: sub_id, + ...(existingMetadata?.Subject ?? {}), }, }, - }, - }; - // } + }; + } this.save({}, false); // Ensure this structure is saved },