From 0150e9751098347b7390276e26a0ea459468f28f Mon Sep 17 00:00:00 2001 From: Garrett Michael Flynn Date: Wed, 13 Mar 2024 09:56:18 -0700 Subject: [PATCH] Update GuidedPathExpansion.js --- .../guided-mode/data/GuidedPathExpansion.js | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) 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 2609918c0..b959660a3 100644 --- a/src/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js +++ b/src/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js @@ -339,28 +339,26 @@ export class GuidedPathExpansionPage extends Page { const globalResults = globalState.results; - if (!keepExistingData) { - for (let sub in globalResults) { - const subRef = results[sub]; - if (!subRef) - delete globalResults[sub]; // Delete removed subjects - else { - for (let ses in globalResults[sub]) { - const sesRef = subRef[ses]; - - if (!sesRef) - delete globalResults[sub][ses]; // Delete removed sessions - else { - const globalSesRef = globalResults[sub][ses]; - - for (let name in globalSesRef.source_data) { - if (!sesRef.source_data[name]) delete globalSesRef.source_data[name]; // Delete removed interfaces - } + for (let sub in globalResults) { + const subRef = results[sub]; + if (!subRef) + delete globalResults[sub]; // Delete removed subjects + else { + for (let ses in globalResults[sub]) { + const sesRef = subRef[ses]; + + if (!sesRef) + delete globalResults[sub][ses]; // Delete removed sessions + else { + const globalSesRef = globalResults[sub][ses]; + + for (let name in globalSesRef.source_data) { + if (!sesRef.source_data[name]) delete globalSesRef.source_data[name]; // Delete removed interfaces } } - - if (Object.keys(globalResults[sub]).length === 0) delete globalResults[sub]; // Delete empty subjects } + + if (Object.keys(globalResults[sub]).length === 0) delete globalResults[sub]; // Delete empty subjects } } };