Skip to content

Commit

Permalink
fix: reset the selected patient if it's not found in the data
Browse files Browse the repository at this point in the history
Properties are saved into the session storage. If the dataset is updated and the
page is refreshed, the saved patient may point to a non-existing patient.
  • Loading branch information
tuner committed Jan 24, 2025
1 parent 927be19 commit 6a8a7c2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gui/gui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ export function setupGui(
let translateY = 0;

const patients = Array.from(new Set(tables.samples.map((d) => d.patient)));
if (generalProps.patient && !patients.includes(generalProps.patient)) {
generalProps.patient = null;
}
generalProps.patient ??= patients[0];

const gui = new GUI({ container: jellyfishGui });
Expand Down

0 comments on commit 6a8a7c2

Please sign in to comment.