Skip to content

Commit 67ee754

Browse files
authored
Merge pull request #783 from Financial-Times/fix-include-highlights-initial-value
Fix includeHighlights initial value
2 parents 440d393 + 633700b commit 67ee754

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

components/x-gift-article/src/GiftArticle.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,12 @@ const withGiftFormActions = withActions(
263263
return (state) => {
264264
state.highlight = document.querySelector(`.${state.highlightClassName}`)?.textContent
265265
state.highlightClassName = document.querySelector(`.${state.highlightClassName}`)?.classList.value
266-
return { highlight: state.highlight, highlightClassName: state.highlightClassName }
266+
state.includeHighlights = true
267+
return {
268+
highlight: state.highlight,
269+
highlightClassName: state.highlightClassName,
270+
includeHighlights: state.includeHighlights
271+
}
267272
}
268273
}
269274
}
@@ -296,7 +301,7 @@ const withGiftFormActions = withActions(
296301
isGiftUrlCreated: false,
297302
isGiftUrlShortened: false,
298303
isNonGiftUrlShortened: false,
299-
includeHighlights: true,
304+
includeHighlights: props.highlight !== undefined,
300305
showAdvancedSharingOptions: false,
301306
showNonSubscriberOptions: false,
302307
highlight: undefined,

0 commit comments

Comments
 (0)