Skip to content

Commit

Permalink
[Reporting] fix updatedAt displaying
Browse files Browse the repository at this point in the history
  • Loading branch information
claire2212 committed May 9, 2024
1 parent c4f3192 commit 53f7ace
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions frontend/src/features/Reportings/ReportingForm/FormContent.tsx
Expand Up @@ -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)
}
Expand Down Expand Up @@ -271,13 +272,12 @@ export function FormContent({ reducedReportingsOnContext, selectedReporting }: F
reporting={selectedReporting}
/>
<SaveBanner>
{!values?.updatedAtUtc && <Italic>Signalement non cr茅茅</Italic>}
{values?.updatedAtUtc && (
<>
<StyledItalic>Derni猫re modification le {formattedUpdatedDate}</StyledItalic>
<AutoSaveTag isAutoSaveEnabled={isAutoSaveEnabled} />
</>
{!values?.updatedAtUtc ? (
<Italic>Signalement non cr茅茅</Italic>
) : (
<StyledItalic>Derni猫re modification le {formattedUpdatedDate}</StyledItalic>
)}
<AutoSaveTag isAutoSaveEnabled={isAutoSaveEnabled} />
</SaveBanner>
<StyledForm $totalReducedReportings={reducedReportingsOnContext}>
<Source />
Expand Down

0 comments on commit 53f7ace

Please sign in to comment.