fix(worklist): selected patient changes randomly when clicked. (#4592)

This commit is contained in:
Ibrahim 2024-12-11 11:49:15 -05:00 committed by GitHub
parent 64a9f3828b
commit 684267b19b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -95,10 +95,13 @@ function WorkList({
const sortModifier = sortDirection === 'descending' ? 1 : -1; const sortModifier = sortDirection === 'descending' ? 1 : -1;
const defaultSortValues = const defaultSortValues =
shouldUseDefaultSort && canSort ? { sortBy: 'studyDate', sortDirection: 'ascending' } : {}; shouldUseDefaultSort && canSort ? { sortBy: 'studyDate', sortDirection: 'ascending' } : {};
const sortedStudies = studies;
if (canSort) { const sortedStudies = useMemo(() => {
studies.sort((s1, s2) => { if (!canSort) {
return studies;
}
return [...studies].sort((s1, s2) => {
if (shouldUseDefaultSort) { if (shouldUseDefaultSort) {
const ascendingSortModifier = -1; const ascendingSortModifier = -1;
return _sortStringDates(s1, s2, ascendingSortModifier); return _sortStringDates(s1, s2, ascendingSortModifier);
@ -121,7 +124,7 @@ function WorkList({
return 0; return 0;
}); });
} }, [canSort, studies, shouldUseDefaultSort, sortBy, sortModifier]);
// ~ Rows & Studies // ~ Rows & Studies
const [expandedRows, setExpandedRows] = useState([]); const [expandedRows, setExpandedRows] = useState([]);
@ -541,7 +544,7 @@ function WorkList({
/> />
<Onboarding /> <Onboarding />
<InvestigationalUseDialog dialogConfiguration={appConfig?.investigationalUseDialog} /> <InvestigationalUseDialog dialogConfiguration={appConfig?.investigationalUseDialog} />
<div className="flex flex-col h-full overflow-y-auto"> <div className="flex h-full flex-col overflow-y-auto">
<ScrollArea> <ScrollArea>
<div className="flex grow flex-col"> <div className="flex grow flex-col">
<StudyListFilter <StudyListFilter