From 7ebe046ca403e3ba353b31417dc5e80d7fedb043 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 19:51:31 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../guided-mode/data/GuidedPathExpansion.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 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 edf3913ae..74e1103c1 100644 --- a/src/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js +++ b/src/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js @@ -274,7 +274,7 @@ export class GuidedPathExpansionPage extends Page { // Force single subject/session if not keeping existing data // if (!globalState.results) { - const subject_id = this.workflow.subject_id.value; + const subject_id = this.workflow.subject_id.value; const session_id = this.workflow.session_id.value; // Map existing results to new subject information (if available) @@ -289,18 +289,17 @@ export class GuidedPathExpansionPage extends Page { if (existing) source_data[key] = existing ?? {}; } - const sub_id = subject_id ?? '' - const ses_id = session_id ?? '' + 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 - + if ((!subject_id || !session_id) && globalState.results) return; // Otherwise reset the results to the new subject/session else { - globalState.results = {} + globalState.results = {}; + + globalState.results[sub_id] = {}; - globalState.results[sub_id] = {} - globalState.results[sub_id][ses_id] = { source_data, metadata: { @@ -312,9 +311,8 @@ export class GuidedPathExpansionPage extends Page { subject_id: sub_id, ...(existingMetadata?.Subject ?? {}), }, - } + }, }; - } this.save({}, false); // Ensure this structure is saved