Skip to content

Commit

Permalink
fix: Cache all studies response for Discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
k-burt-uch committed Feb 19, 2025
1 parent f133f22 commit 8011096
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Discovery/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ const populateStudiesWithConfigInfo = (studies, config) => {
});
};

let allStudies;

const DiscoveryWithMDSBackend: React.FC<{
userAggregateAuthMappings: any,
config: DiscoveryConfig,
Expand Down Expand Up @@ -128,7 +130,11 @@ const DiscoveryWithMDSBackend: React.FC<{
}),
);
}
return _.union(rawStudiesRegistered, rawStudiesUnregistered);
const result = _.union(rawStudiesRegistered, rawStudiesUnregistered);
if (numberOfBatchesLoaded > 0) {
allStudies = result;
}
return allStudies || result;
}
fetchRawStudies().then((rawStudies) => {
let studiesToSet;
Expand Down

0 comments on commit 8011096

Please sign in to comment.