Skip to content

Commit 53802b5

Browse files
committed
Fix condition for dref application export
1 parent f85a8b1 commit 53802b5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/views/DrefApplicationExport/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,14 @@ export function Component() {
179179
&& isTruthyString(drefResponse?.anticipatory_actions?.trim());
180180
const eventDateDefined = drefResponse?.type_of_dref !== DREF_TYPE_IMMINENT
181181
&& isDefined(drefResponse?.event_date);
182+
const eventTextDefined = drefResponse?.type_of_dref === DREF_TYPE_IMMINENT
183+
&& isDefined(drefResponse?.event_text);
182184
const showEventDescriptionSection = eventDescriptionDefined
183185
|| eventScopeDefined
184186
|| imagesFileDefined
185187
|| anticipatoryActionsDefined
186188
|| eventDateDefined
189+
|| eventTextDefined
187190
|| isDefined(drefResponse?.event_map_file?.file);
188191

189192
const lessonsLearnedDefined = isTruthyString(drefResponse?.lessons_learned?.trim());
@@ -478,9 +481,7 @@ export function Component() {
478481
</Link>
479482
</Container>
480483
)}
481-
{isDefined(drefResponse)
482-
&& drefResponse.type_of_dref === DREF_TYPE_IMMINENT
483-
&& isTruthyString(drefResponse.event_text) && (
484+
{eventTextDefined && (
484485
<Container
485486
heading={strings.approximateDateOfImpactHeading}
486487
headingLevel={3}

0 commit comments

Comments
 (0)