Skip to content

Commit

Permalink
(chore): Update tsconfig and hook loading condition
Browse files Browse the repository at this point in the history
  • Loading branch information
NethmiRodrigo committed Aug 9, 2024
1 parent 4457a4b commit af46083
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/hooks/useConceptName.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import useSWR from 'swr';
import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
import { isEmpty } from '@openmrs/openmrs-form-engine-lib';

export function useConceptName(conceptId: string | undefined) {
const customRepresentation = 'custom:(name:(display))';
Expand All @@ -11,6 +10,6 @@ export function useConceptName(conceptId: string | undefined) {
return {
conceptName: data?.data?.name?.display ?? null,
conceptNameLookupError: error,
isLoadingConceptName: !conceptId || isEmpty(conceptId) ? false : (!data && !error) || false,
isLoadingConceptName: (conceptId && !data && !error) || false,
};
}

0 comments on commit af46083

Please sign in to comment.