Skip to content

Commit

Permalink
fix: do not show preview image on version < 41
Browse files Browse the repository at this point in the history
  • Loading branch information
superskip committed Feb 28, 2024
1 parent 0bec8a7 commit 0b733c4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core_modules/capture-core/converters/clientToList.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import moment from 'moment';
import i18n from '@dhis2/d2-i18n';
import { Tag } from '@dhis2/ui';
import { PreviewImage } from 'capture-ui';
import { featureAvailable, FEATURES } from 'capture-core-utils';
import { dataElementTypes, type DataElement } from '../metaData';
import { convertMomentToDateFormatString } from '../utils/converters/date';
import { stringifyNumber } from './common/stringifyNumber';
Expand Down Expand Up @@ -46,11 +47,11 @@ function convertFileForDisplay(clientValue: FileClientValue) {
}

function convertImageForDisplay(clientValue: FileClientValue) {
return (
return featureAvailable(FEATURES.trackerImageEndpoint) ? (
<PreviewImage
url={clientValue.url}
/>
);
) : convertFileForDisplay(clientValue);
}

function convertRangeForDisplay(parser: any, clientValue: any) {
Expand Down

0 comments on commit 0b733c4

Please sign in to comment.