Skip to content

Commit

Permalink
Fix bug with recursion (ohcnetwork#9100)
Browse files Browse the repository at this point in the history
  • Loading branch information
shivankacker authored Nov 13, 2024
1 parent 5bb46fa commit 7acc8be
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/components/Facility/ConsultationDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,12 @@ const defaultTabs = {
export const ConsultationDetails = (props: any) => {
const { facilityId, patientId, consultationId } = props;
const { t } = useTranslation();
const [tabs, setTabs] =
useState<Record<string, React.FC<ConsultationTabProps>>>(defaultTabs);
const pluginTabs = useCareAppConsultationTabs();

useEffect(() => {
if (pluginTabs) {
setTabs((prev) => ({ ...prev, ...pluginTabs }));
}
}, [pluginTabs]);
const tabs: Record<string, React.FC<ConsultationTabProps>> = {
...defaultTabs,
...pluginTabs,
};

let tab = undefined;
if (Object.keys(tabs).includes(props.tab.toUpperCase())) {
Expand Down

0 comments on commit 7acc8be

Please sign in to comment.