Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
fix(patients): stop "Loading..." when patient has no related persons
Browse files Browse the repository at this point in the history
  • Loading branch information
archwheeler committed Feb 6, 2020
1 parent f15c238 commit e513b17
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/patients/related-persons/RelatedPersonTab.tsx
Expand Up @@ -32,9 +32,9 @@ const RelatedPersonTab = (props: Props) => {
fetchedRelatedPersons.push(fetchedRelatedPerson)
}),
)

setRelatedPersons(fetchedRelatedPersons)
}

setRelatedPersons(fetchedRelatedPersons)
}

fetchRelatedPersons()
Expand Down Expand Up @@ -88,14 +88,17 @@ const RelatedPersonTab = (props: Props) => {
<div className="col-md-12">
<Panel title={t('patient.relatedPersons.label')} color="primary" collapsible>
{relatedPersons ? (
<List>
{relatedPersons.map((r) => (
<ListItem key={r.id}>{r.fullName}</ListItem>
))}
</List>
) : (
<h1>Loading...</h1>
)}
(relatedPersons.length > 0) ? (
<List>
{relatedPersons.map((r) => (
<ListItem key={r.id}>{r.fullName}</ListItem>
))}
</List>
) : (
<h2>No related persons have been added yet.</h2>
)) : (
<h1>Loading...</h1>
)}
</Panel>
</div>
</div>
Expand Down

0 comments on commit e513b17

Please sign in to comment.