Skip to content

Commit

Permalink
fix: prevented mutation of array
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoalee committed Jan 23, 2025
1 parent 49af43d commit 5392d03
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ const DisplayMetaAnalysisResults: React.FC<{
if (!neurovaultFiles || !metaAnalysis || !(metaAnalysis?.specification as Specification).estimator?.type)
return [];

const orderMap = new Map(NimareOutputs.reverse().map((output, index) => [output.key, index]));
// In the array, z is first. However, we want it to have more weight so we reverse the array and give it a higher index
// Note: This array must be cloned as reverse() will mutate the array
const orderMap = new Map([...NimareOutputs].reverse().map((output, index) => [output.key, index]));

// We want the order of the files to be very specific:
// if algorithm is MKDAChi2, then set 1st image to be z_desc-associationMass
// set 2nd image to be z_desc-uniformityMass
Expand Down

0 comments on commit 5392d03

Please sign in to comment.