Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix old keepExistingData reference #667

Merged
merged 2 commits into from
Mar 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -342,28 +342,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
}
}
};
Expand Down
Loading