Skip to content

Commit c48eb89

Browse files
frozenheliumbarshathakuri
authored andcommitted
Add proper condition in description of event for event date
1 parent 7bce9b8 commit c48eb89

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/views/DrefApplicationExport/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,13 @@ export function Component() {
177177
&& drefResponse.images_file.length > 0;
178178
const anticipatoryActionsDefined = drefResponse?.type_of_dref === DREF_TYPE_IMMINENT
179179
&& isTruthyString(drefResponse?.anticipatory_actions?.trim());
180+
const eventDateDefined = drefResponse?.type_of_dref !== DREF_TYPE_IMMINENT
181+
&& isDefined(drefResponse?.event_date);
180182
const showEventDescriptionSection = eventDescriptionDefined
181183
|| eventScopeDefined
182184
|| imagesFileDefined
183185
|| anticipatoryActionsDefined
186+
|| eventDateDefined
184187
|| isDefined(drefResponse?.event_map_file?.file);
185188

186189
const lessonsLearnedDefined = isTruthyString(drefResponse?.lessons_learned?.trim());
@@ -495,11 +498,8 @@ export function Component() {
495498
/>
496499
</Container>
497500
)}
498-
{isDefined(drefResponse?.event_date) && (
499-
<Container
500-
heading={drefResponse?.type_of_dref !== DREF_TYPE_IMMINENT
501-
&& strings.dateWhenTheTriggerWasMetHeading}
502-
>
501+
{eventDateDefined && (
502+
<Container heading={strings.dateWhenTheTriggerWasMetHeading}>
503503
<DateOutput
504504
value={drefResponse?.event_date}
505505
/>

0 commit comments

Comments
 (0)