Skip to content

Commit adadb07

Browse files
committed
πŸ”€ fix scientist card render issue when switching between shared reports
1 parent 5a2d03c commit adadb07

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hhmi/compliance': patch
3+
---
4+
5+
Fixes scientist card update bug when switching between two shared dashboards

β€Žpackages/compliance/src/components/ComplianceReport.tsxβ€Ž

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,13 @@ export function ComplianceReport({
7272
setError('Failed to load scientist data');
7373
setIsLoadingScientist(false);
7474
});
75+
} else {
76+
// Handle non-Promise scientist prop changes (e.g., when route parameter changes)
77+
setScientist(scientistProp);
78+
setError(errorProp);
79+
setIsLoadingScientist(false);
7580
}
76-
}, [scientistProp]);
81+
}, [scientistProp, errorProp, orcid]);
7782

7883
const handleShareClick = () => {
7984
pingEvent(HHMITrackEvent.HHMI_COMPLIANCE_REPORT_SHARE_CLICKED, {

0 commit comments

Comments
Β (0)