Skip to content

Commit

Permalink
Check entire studies list for "All" study instead of first index
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro-Vega committed Dec 31, 2024
1 parent 5d26765 commit ca9a60d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/dashboardUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export const addStudiesParameter = (user: User): DashboardContentOptions["parame
const params: DashboardContentOptions["parameters"] = [];
const { studies } = user || {};

// If "All" is the first study, do NOT push the "studiesParameter"
if (studies?.[0]?._id === "All") {
// If user contains the "All" study, do NOT push the "studiesParameter"
if ((studies || [])?.findIndex((s) => s?._id === "All") !== -1) {
return params;
}

Expand Down

0 comments on commit ca9a60d

Please sign in to comment.