Skip to content

Commit

Permalink
fix: show 'Profile' instead of 'False' during loading
Browse files Browse the repository at this point in the history
  • Loading branch information
eirikhaugstulen committed Jan 15, 2025
1 parent db08e5d commit 5652172
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,14 @@ const WidgetProfilePlain = ({
<Widget
header={
<div className={classes.header}>
<div>{i18n.t('{{trackedEntityTypeName}} profile', {
trackedEntityTypeName,
interpolation: { escapeValue: false },
})}</div>
<div>
{trackedEntityTypeName
? i18n.t('{{trackedEntityTypeName}} profile', {
trackedEntityTypeName,
interpolation: { escapeValue: false },
})
: i18n.t('Profile')}
</div>
<div className={classes.actions}>
{isEditable && (
<Button onClick={() => setTeiModalState(TEI_MODAL_STATE.OPEN)} secondary small>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import { useMemo, useState, useEffect } from 'react';
import { useEffect, useMemo, useState } from 'react';
import { useDataQuery } from '@dhis2/app-runtime';
import type { Geometry } from '../DataEntry/helpers/types';

Expand Down Expand Up @@ -93,7 +93,7 @@ export const useTrackedEntityInstances = (
loading,
trackedEntity: !loading && data?.trackedEntityInstance,
trackedEntityInstanceAttributes: !loading && trackedEntityInstanceAttributes,
trackedEntityTypeName: !tetLoading && tetData?.trackedEntityType?.displayName,
trackedEntityTypeName: tetLoading ? undefined : tetData?.trackedEntityType?.displayName,
trackedEntityTypeAccess: !tetLoading && tetData?.trackedEntityType?.access,
geometry,
};
Expand Down

0 comments on commit 5652172

Please sign in to comment.