From 706aa70ce5d2d7b9ef7fccfb7616002cf0944de4 Mon Sep 17 00:00:00 2001 From: christianwenifr Date: Thu, 16 Mar 2023 15:45:14 +0700 Subject: [PATCH 1/4] fix 15963: Add condition for border line display --- src/components/OptionRow.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/OptionRow.js b/src/components/OptionRow.js index 532ae783bdd6..ad25b29685dd 100644 --- a/src/components/OptionRow.js +++ b/src/components/OptionRow.js @@ -100,7 +100,8 @@ class OptionRow extends Component { || this.props.option.text !== nextProps.option.text || this.props.option.alternateText !== nextProps.option.alternateText || this.props.option.descriptiveText !== nextProps.option.descriptiveText - || this.props.option.brickRoadIndicator !== nextProps.option.brickRoadIndicator; + || this.props.option.brickRoadIndicator !== nextProps.option.brickRoadIndicator + || this.props.shouldHaveOptionSeparator !== nextProps.shouldHaveOptionSeparator; } componentDidUpdate(prevProps) { From 3cc57614a25cab722e56b2954478910eba89935a Mon Sep 17 00:00:00 2001 From: tienifr Date: Mon, 20 Mar 2023 16:56:51 +0700 Subject: [PATCH 2/4] fix: Add condition for border line display --- src/components/OptionRow.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/OptionRow.js b/src/components/OptionRow.js index 532ae783bdd6..ad25b29685dd 100644 --- a/src/components/OptionRow.js +++ b/src/components/OptionRow.js @@ -100,7 +100,8 @@ class OptionRow extends Component { || this.props.option.text !== nextProps.option.text || this.props.option.alternateText !== nextProps.option.alternateText || this.props.option.descriptiveText !== nextProps.option.descriptiveText - || this.props.option.brickRoadIndicator !== nextProps.option.brickRoadIndicator; + || this.props.option.brickRoadIndicator !== nextProps.option.brickRoadIndicator + || this.props.shouldHaveOptionSeparator !== nextProps.shouldHaveOptionSeparator; } componentDidUpdate(prevProps) { From e8a2a0cac593606c45e2093df720e58200fb9e41 Mon Sep 17 00:00:00 2001 From: tienifr Date: Tue, 21 Mar 2023 10:28:52 +0700 Subject: [PATCH 3/4] Additional checks in OptionRow shouldComponentUpdate --- src/components/OptionRow.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/OptionRow.js b/src/components/OptionRow.js index ad25b29685dd..1ee8315fd4bc 100644 --- a/src/components/OptionRow.js +++ b/src/components/OptionRow.js @@ -101,6 +101,11 @@ class OptionRow extends Component { || this.props.option.alternateText !== nextProps.option.alternateText || this.props.option.descriptiveText !== nextProps.option.descriptiveText || this.props.option.brickRoadIndicator !== nextProps.option.brickRoadIndicator + || this.props.option.shouldShowSubscript !== nextProps.option.shouldShowSubscript + || this.props.option.icons !== nextProps.option.icons + || this.props.option.ownerEmail !== nextProps.option.ownerEmail + || this.props.option.subtitle !== nextProps.option.subtitle + || this.props.option.pendingAction !== nextProps.option.pendingAction || this.props.shouldHaveOptionSeparator !== nextProps.shouldHaveOptionSeparator; } From 40f6fba01e092979860587a87e40d31dcbe6c78b Mon Sep 17 00:00:00 2001 From: tienifr Date: Tue, 21 Mar 2023 21:53:15 +0700 Subject: [PATCH 4/4] fix: optimize code --- src/components/OptionRow.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/OptionRow.js b/src/components/OptionRow.js index 1ee8315fd4bc..0904f16f05ca 100644 --- a/src/components/OptionRow.js +++ b/src/components/OptionRow.js @@ -93,6 +93,7 @@ class OptionRow extends Component { return this.state.isDisabled !== nextState.isDisabled || this.props.isDisabled !== nextProps.isDisabled || this.props.isSelected !== nextProps.isSelected + || this.props.shouldHaveOptionSeparator !== nextProps.shouldHaveOptionSeparator || this.props.showSelectedState !== nextProps.showSelectedState || this.props.showTitleTooltip !== nextProps.showTitleTooltip || !_.isEqual(this.props.option.icons, nextProps.option.icons) @@ -102,11 +103,9 @@ class OptionRow extends Component { || this.props.option.descriptiveText !== nextProps.option.descriptiveText || this.props.option.brickRoadIndicator !== nextProps.option.brickRoadIndicator || this.props.option.shouldShowSubscript !== nextProps.option.shouldShowSubscript - || this.props.option.icons !== nextProps.option.icons || this.props.option.ownerEmail !== nextProps.option.ownerEmail || this.props.option.subtitle !== nextProps.option.subtitle - || this.props.option.pendingAction !== nextProps.option.pendingAction - || this.props.shouldHaveOptionSeparator !== nextProps.shouldHaveOptionSeparator; + || this.props.option.pendingAction !== nextProps.option.pendingAction; } componentDidUpdate(prevProps) {