diff --git a/frontend/src/features/Reportings/ReportingForm/FormContent.tsx b/frontend/src/features/Reportings/ReportingForm/FormContent.tsx index f0badff25..ea6e67045 100644 --- a/frontend/src/features/Reportings/ReportingForm/FormContent.tsx +++ b/frontend/src/features/Reportings/ReportingForm/FormContent.tsx @@ -221,8 +221,9 @@ export function FormContent({ reducedReportingsOnContext, selectedReporting }: F return } if ( - values?.updatedAtUtc && - !customDayjs(selectedReporting?.updatedAtUtc).isSame(customDayjs(values?.updatedAtUtc), 'minutes') + (values?.updatedAtUtc && + !customDayjs(selectedReporting?.updatedAtUtc).isSame(customDayjs(values?.updatedAtUtc), 'minutes')) || + (!values.updatedAtUtc && selectedReporting?.updatedAtUtc) ) { setFieldValue('updatedAtUtc', selectedReporting?.updatedAtUtc) } @@ -271,13 +272,12 @@ export function FormContent({ reducedReportingsOnContext, selectedReporting }: F reporting={selectedReporting} /> - {!values?.updatedAtUtc && Signalement non créé} - {values?.updatedAtUtc && ( - <> - Dernière modification le {formattedUpdatedDate} - - + {!values?.updatedAtUtc ? ( + Signalement non créé + ) : ( + Dernière modification le {formattedUpdatedDate} )} +