From 014d239f3b6ae46921cfe64d846f89f31c2e792a Mon Sep 17 00:00:00 2001 From: David Bondy Date: Fri, 19 May 2023 16:25:53 -0600 Subject: [PATCH 01/20] refactor to functional component --- .../settings/Security/CloseAccountPage.js | 126 ++++++++---------- 1 file changed, 55 insertions(+), 71 deletions(-) diff --git a/src/pages/settings/Security/CloseAccountPage.js b/src/pages/settings/Security/CloseAccountPage.js index 6d0988401137..0702338ad277 100644 --- a/src/pages/settings/Security/CloseAccountPage.js +++ b/src/pages/settings/Security/CloseAccountPage.js @@ -1,4 +1,6 @@ -import React, {Component} from 'react'; +import React, { + useCallback, useState, +} from 'react'; import {View} from 'react-native'; import {withOnyx} from 'react-native-onyx'; import PropTypes from 'prop-types'; @@ -37,105 +39,87 @@ const defaultProps = { }, }; -class CloseAccountPage extends Component { - constructor(props) { - super(props); +function CloseAccountPage (props) { + const [isConfirmModalVisible, setConfirmModalVisibility] = useState(false); + const [reasonForLeaving, setReasonForLeaving] = useState(''); - this.onConfirm = this.onConfirm.bind(this); - this.validate = this.validate.bind(this); - this.hideConfirmModal = this.hideConfirmModal.bind(this); - this.showConfirmModal = this.showConfirmModal.bind(this); - CloseAccount.clearError(); - this.state = { - isConfirmModalVisible: false, - reasonForLeaving: '', - }; - } + const hideConfirmModal = useCallback(() => { + setConfirmModalVisibility(false); + }); - componentWillUnmount() { - CloseAccount.clearError(); - } + const onConfirm = useCallback(() => { + User.closeAccount(reasonForLeaving); + hideConfirmModal(); + }); - onConfirm() { - User.closeAccount(this.state.reasonForLeaving); - this.hideConfirmModal(); - } + const showConfirmModal = useCallback((values) => { + setConfirmModalVisibility(true); + setReasonForLeaving(values.reasonForLeaving); + }); - showConfirmModal(values) { - this.setState({ - isConfirmModalVisible: true, - reasonForLeaving: values.reasonForLeaving, - }); - } - - hideConfirmModal() { - this.setState({isConfirmModalVisible: false}); - } - - validate(values) { - const userEmailOrPhone = this.props.formatPhoneNumber(this.props.session.email); + const validate = useCallback((values) => { + const userEmailOrPhone = props.formatPhoneNumber(props.session.email); const errors = {}; if (_.isEmpty(values.phoneOrEmail) || userEmailOrPhone.toLowerCase() !== values.phoneOrEmail.toLowerCase()) { - errors.phoneOrEmail = this.props.translate('closeAccountPage.enterYourDefaultContactMethod'); + errors.phoneOrEmail = props.translate('closeAccountPage.enterYourDefaultContactMethod'); } return errors; - } + }); + + const userEmailOrPhone = props.formatPhoneNumber(props.session.email); - render() { - const userEmailOrPhone = this.props.formatPhoneNumber(this.props.session.email); - return ( - - Navigation.navigate(ROUTES.SETTINGS_SECURITY)} - onCloseButtonPress={() => Navigation.dismissModal(true)} - /> -
- - {this.props.translate('closeAccountPage.reasonForLeavingPrompt')} + return ( + + Navigation.navigate(ROUTES.SETTINGS_SECURITY)} + onCloseButtonPress={() => Navigation.dismissModal(true)} + /> + + + {props.translate('closeAccountPage.reasonForLeavingPrompt')} - {this.props.translate('closeAccountPage.enterDefaultContactToConfirm')} {userEmailOrPhone}. + {props.translate('closeAccountPage.enterDefaultContactToConfirm')} {userEmailOrPhone}. - - - - ); - } +
+ +
+ ); } CloseAccountPage.propTypes = propTypes; From bd80ad9d531d48a0aa29720cc3280cac8fe839b3 Mon Sep 17 00:00:00 2001 From: David Bondy Date: Mon, 22 May 2023 15:13:35 -0600 Subject: [PATCH 02/20] remove unused method --- src/libs/actions/CloseAccount.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/libs/actions/CloseAccount.js b/src/libs/actions/CloseAccount.js index 8a8f395277e1..b43120e7da30 100644 --- a/src/libs/actions/CloseAccount.js +++ b/src/libs/actions/CloseAccount.js @@ -2,13 +2,6 @@ import Onyx from 'react-native-onyx'; import ONYXKEYS from '../../ONYXKEYS'; import CONST from '../../CONST'; -/** - * Clear CloseAccount error message to hide modal - */ -function clearError() { - Onyx.merge(ONYXKEYS.FORMS.CLOSE_ACCOUNT_FORM, {errors: null}); -} - /** * Set default Onyx data */ @@ -17,7 +10,5 @@ function setDefaultData() { } export { - // eslint-disable-next-line import/prefer-default-export - clearError, setDefaultData, }; From 86c0b3f59cb1ef4a8f7720443f3d3ac81d43ef0a Mon Sep 17 00:00:00 2001 From: David Bondy Date: Mon, 22 May 2023 15:14:01 -0600 Subject: [PATCH 03/20] dont use useCallback here as its most likely not needed --- src/pages/settings/Security/CloseAccountPage.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/pages/settings/Security/CloseAccountPage.js b/src/pages/settings/Security/CloseAccountPage.js index 0702338ad277..838607d01628 100644 --- a/src/pages/settings/Security/CloseAccountPage.js +++ b/src/pages/settings/Security/CloseAccountPage.js @@ -43,21 +43,21 @@ function CloseAccountPage (props) { const [isConfirmModalVisible, setConfirmModalVisibility] = useState(false); const [reasonForLeaving, setReasonForLeaving] = useState(''); - const hideConfirmModal = useCallback(() => { + const hideConfirmModal = () => { setConfirmModalVisibility(false); - }); + }; - const onConfirm = useCallback(() => { + const onConfirm = () => { User.closeAccount(reasonForLeaving); hideConfirmModal(); - }); + }; - const showConfirmModal = useCallback((values) => { + const showConfirmModal = (values) => { setConfirmModalVisibility(true); setReasonForLeaving(values.reasonForLeaving); - }); + }; - const validate = useCallback((values) => { + const validate = (values) => { const userEmailOrPhone = props.formatPhoneNumber(props.session.email); const errors = {}; @@ -65,7 +65,7 @@ function CloseAccountPage (props) { errors.phoneOrEmail = props.translate('closeAccountPage.enterYourDefaultContactMethod'); } return errors; - }); + }; const userEmailOrPhone = props.formatPhoneNumber(props.session.email); From df15ca036740d1efcb5243d43558d1ec1724609e Mon Sep 17 00:00:00 2001 From: David Bondy Date: Mon, 22 May 2023 15:51:42 -0600 Subject: [PATCH 04/20] clean up imports --- src/pages/settings/Security/CloseAccountPage.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/settings/Security/CloseAccountPage.js b/src/pages/settings/Security/CloseAccountPage.js index 838607d01628..cd79e1ac54b2 100644 --- a/src/pages/settings/Security/CloseAccountPage.js +++ b/src/pages/settings/Security/CloseAccountPage.js @@ -1,5 +1,5 @@ import React, { - useCallback, useState, + useState, } from 'react'; import {View} from 'react-native'; import {withOnyx} from 'react-native-onyx'; @@ -16,7 +16,6 @@ import TextInput from '../../../components/TextInput'; import Text from '../../../components/Text'; import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize'; import withWindowDimensions, {windowDimensionsPropTypes} from '../../../components/withWindowDimensions'; -import * as CloseAccount from '../../../libs/actions/CloseAccount'; import ONYXKEYS from '../../../ONYXKEYS'; import Form from '../../../components/Form'; import CONST from '../../../CONST'; From 270b71ce0b21fd6f38f635b98caac1a354023014 Mon Sep 17 00:00:00 2001 From: David Bondy Date: Thu, 25 May 2023 11:26:09 -0600 Subject: [PATCH 05/20] export default and clean up usage --- src/libs/actions/CloseAccount.js | 2 +- src/pages/signin/LoginForm.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/actions/CloseAccount.js b/src/libs/actions/CloseAccount.js index b43120e7da30..a23c91bb6bf3 100644 --- a/src/libs/actions/CloseAccount.js +++ b/src/libs/actions/CloseAccount.js @@ -9,6 +9,6 @@ function setDefaultData() { Onyx.merge(ONYXKEYS.FORMS.CLOSE_ACCOUNT_FORM, {...CONST.DEFAULT_CLOSE_ACCOUNT_DATA}); } -export { +export default { setDefaultData, }; diff --git a/src/pages/signin/LoginForm.js b/src/pages/signin/LoginForm.js index 437612908081..caccdc3aec9b 100755 --- a/src/pages/signin/LoginForm.js +++ b/src/pages/signin/LoginForm.js @@ -22,7 +22,7 @@ import {withNetwork} from '../../components/OnyxProvider'; import networkPropTypes from '../../components/networkPropTypes'; import * as ErrorUtils from '../../libs/ErrorUtils'; import DotIndicatorMessage from '../../components/DotIndicatorMessage'; -import * as CloseAccount from '../../libs/actions/CloseAccount'; +import setDefaultData from '../../libs/actions/CloseAccount'; import CONST from '../../CONST'; const propTypes = { @@ -114,7 +114,7 @@ class LoginForm extends React.Component { // Clear the "Account successfully closed" message when the user starts typing if (this.props.closeAccount.success) { - CloseAccount.setDefaultData(); + setDefaultData(); } } @@ -135,7 +135,7 @@ class LoginForm extends React.Component { // If account was closed and have success message in Onyx, we clear it here if (!_.isEmpty(this.props.closeAccount.success)) { - CloseAccount.setDefaultData(); + setDefaultData(); } const login = this.state.login.trim(); From 5d050a0ff73b8546c5abc78818dcfbd2b5b2c12d Mon Sep 17 00:00:00 2001 From: David Bondy Date: Thu, 25 May 2023 11:38:20 -0600 Subject: [PATCH 06/20] fix default error key as defined by Onyx::handleException in web-e --- src/CONST.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CONST.js b/src/CONST.js index 3cb4b110be74..3a6129b7d3d1 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -727,7 +727,7 @@ const CONST = { }, DEFAULT_TIME_ZONE: {automatic: true, selected: 'America/Los_Angeles'}, DEFAULT_ACCOUNT_DATA: {errors: null, success: '', isLoading: false}, - DEFAULT_CLOSE_ACCOUNT_DATA: {error: '', success: '', isLoading: false}, + DEFAULT_CLOSE_ACCOUNT_DATA: {errors: '', success: '', isLoading: false}, FORMS: { LOGIN_FORM: 'LoginForm', VALIDATE_CODE_FORM: 'ValidateCodeForm', From ecbef943d9bf41e5ff460b3120a3cb4495af8dc1 Mon Sep 17 00:00:00 2001 From: David Bondy Date: Fri, 26 May 2023 16:25:17 -0600 Subject: [PATCH 07/20] Revert "remove unused method" This reverts commit bd80ad9d531d48a0aa29720cc3280cac8fe839b3. --- src/libs/actions/CloseAccount.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/CloseAccount.js b/src/libs/actions/CloseAccount.js index a23c91bb6bf3..8a8f395277e1 100644 --- a/src/libs/actions/CloseAccount.js +++ b/src/libs/actions/CloseAccount.js @@ -2,6 +2,13 @@ import Onyx from 'react-native-onyx'; import ONYXKEYS from '../../ONYXKEYS'; import CONST from '../../CONST'; +/** + * Clear CloseAccount error message to hide modal + */ +function clearError() { + Onyx.merge(ONYXKEYS.FORMS.CLOSE_ACCOUNT_FORM, {errors: null}); +} + /** * Set default Onyx data */ @@ -9,6 +16,8 @@ function setDefaultData() { Onyx.merge(ONYXKEYS.FORMS.CLOSE_ACCOUNT_FORM, {...CONST.DEFAULT_CLOSE_ACCOUNT_DATA}); } -export default { +export { + // eslint-disable-next-line import/prefer-default-export + clearError, setDefaultData, }; From 4779d8e27dc18cbce2f7a16eca24fc0a9ab0d82c Mon Sep 17 00:00:00 2001 From: David Bondy Date: Fri, 26 May 2023 16:27:55 -0600 Subject: [PATCH 08/20] Revert "export default and clean up usage" This reverts commit 270b71ce0b21fd6f38f635b98caac1a354023014. --- src/pages/signin/LoginForm.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/signin/LoginForm.js b/src/pages/signin/LoginForm.js index caccdc3aec9b..437612908081 100755 --- a/src/pages/signin/LoginForm.js +++ b/src/pages/signin/LoginForm.js @@ -22,7 +22,7 @@ import {withNetwork} from '../../components/OnyxProvider'; import networkPropTypes from '../../components/networkPropTypes'; import * as ErrorUtils from '../../libs/ErrorUtils'; import DotIndicatorMessage from '../../components/DotIndicatorMessage'; -import setDefaultData from '../../libs/actions/CloseAccount'; +import * as CloseAccount from '../../libs/actions/CloseAccount'; import CONST from '../../CONST'; const propTypes = { @@ -114,7 +114,7 @@ class LoginForm extends React.Component { // Clear the "Account successfully closed" message when the user starts typing if (this.props.closeAccount.success) { - setDefaultData(); + CloseAccount.setDefaultData(); } } @@ -135,7 +135,7 @@ class LoginForm extends React.Component { // If account was closed and have success message in Onyx, we clear it here if (!_.isEmpty(this.props.closeAccount.success)) { - setDefaultData(); + CloseAccount.setDefaultData(); } const login = this.state.login.trim(); From cce3f22aaad019d85bbbf858a234d1326f73837e Mon Sep 17 00:00:00 2001 From: David Bondy Date: Fri, 26 May 2023 16:30:02 -0600 Subject: [PATCH 09/20] Revert "clean up imports" This reverts commit df15ca036740d1efcb5243d43558d1ec1724609e. --- src/pages/settings/Security/CloseAccountPage.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/settings/Security/CloseAccountPage.js b/src/pages/settings/Security/CloseAccountPage.js index cd79e1ac54b2..838607d01628 100644 --- a/src/pages/settings/Security/CloseAccountPage.js +++ b/src/pages/settings/Security/CloseAccountPage.js @@ -1,5 +1,5 @@ import React, { - useState, + useCallback, useState, } from 'react'; import {View} from 'react-native'; import {withOnyx} from 'react-native-onyx'; @@ -16,6 +16,7 @@ import TextInput from '../../../components/TextInput'; import Text from '../../../components/Text'; import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize'; import withWindowDimensions, {windowDimensionsPropTypes} from '../../../components/withWindowDimensions'; +import * as CloseAccount from '../../../libs/actions/CloseAccount'; import ONYXKEYS from '../../../ONYXKEYS'; import Form from '../../../components/Form'; import CONST from '../../../CONST'; From e25a3b16f6ff6a25bfd28773cd7fe782b4ce639a Mon Sep 17 00:00:00 2001 From: David Bondy Date: Fri, 26 May 2023 17:02:20 -0600 Subject: [PATCH 10/20] copy functionality based on lifecycle methods to not change behavior too much --- src/pages/settings/Security/CloseAccountPage.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pages/settings/Security/CloseAccountPage.js b/src/pages/settings/Security/CloseAccountPage.js index 838607d01628..a5cfcf8c9922 100644 --- a/src/pages/settings/Security/CloseAccountPage.js +++ b/src/pages/settings/Security/CloseAccountPage.js @@ -1,5 +1,6 @@ import React, { - useCallback, useState, + useState, + useEffect, } from 'react'; import {View} from 'react-native'; import {withOnyx} from 'react-native-onyx'; @@ -43,6 +44,13 @@ function CloseAccountPage (props) { const [isConfirmModalVisible, setConfirmModalVisibility] = useState(false); const [reasonForLeaving, setReasonForLeaving] = useState(''); + useEffect(() => { + CloseAccount.setDefaultData(); + return () => { + CloseAccount.clearError(); + }; + }); + const hideConfirmModal = () => { setConfirmModalVisibility(false); }; From 5da45fada7e86fa3536dbf8ecbc74ef1b2bf2cb2 Mon Sep 17 00:00:00 2001 From: David Bondy Date: Fri, 2 Jun 2023 09:40:51 -0600 Subject: [PATCH 11/20] fix default type to stop console error --- src/CONST.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CONST.js b/src/CONST.js index 9c96f4706821..bb0c5fec2cbd 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -727,7 +727,7 @@ const CONST = { }, DEFAULT_TIME_ZONE: {automatic: true, selected: 'America/Los_Angeles'}, DEFAULT_ACCOUNT_DATA: {errors: null, success: '', isLoading: false}, - DEFAULT_CLOSE_ACCOUNT_DATA: {errors: '', success: '', isLoading: false}, + DEFAULT_CLOSE_ACCOUNT_DATA: {errors: {}, success: '', isLoading: false}, FORMS: { LOGIN_FORM: 'LoginForm', VALIDATE_CODE_FORM: 'ValidateCodeForm', From 477631eecb0141fd91b7108955a9ecbab90c4d8f Mon Sep 17 00:00:00 2001 From: David Bondy Date: Fri, 2 Jun 2023 10:04:03 -0600 Subject: [PATCH 12/20] remove setting default data on component mount, its not 100% necessary --- src/pages/settings/Security/CloseAccountPage.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/settings/Security/CloseAccountPage.js b/src/pages/settings/Security/CloseAccountPage.js index a5cfcf8c9922..80aa532c6861 100644 --- a/src/pages/settings/Security/CloseAccountPage.js +++ b/src/pages/settings/Security/CloseAccountPage.js @@ -45,7 +45,6 @@ function CloseAccountPage (props) { const [reasonForLeaving, setReasonForLeaving] = useState(''); useEffect(() => { - CloseAccount.setDefaultData(); return () => { CloseAccount.clearError(); }; From 3830a3ed00437e48d8b90aced4d9261200e55e10 Mon Sep 17 00:00:00 2001 From: David Bondy Date: Fri, 2 Jun 2023 10:14:15 -0600 Subject: [PATCH 13/20] fix linter --- src/pages/settings/Security/CloseAccountPage.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/pages/settings/Security/CloseAccountPage.js b/src/pages/settings/Security/CloseAccountPage.js index 80aa532c6861..036fc5fe799b 100644 --- a/src/pages/settings/Security/CloseAccountPage.js +++ b/src/pages/settings/Security/CloseAccountPage.js @@ -44,11 +44,7 @@ function CloseAccountPage (props) { const [isConfirmModalVisible, setConfirmModalVisibility] = useState(false); const [reasonForLeaving, setReasonForLeaving] = useState(''); - useEffect(() => { - return () => { - CloseAccount.clearError(); - }; - }); + useEffect(() => () => CloseAccount.clearError()); const hideConfirmModal = () => { setConfirmModalVisibility(false); From b9069f7bc27eeefa0fc0cb8bb7173b78a5397ddc Mon Sep 17 00:00:00 2001 From: David Bondy Date: Fri, 2 Jun 2023 10:27:44 -0600 Subject: [PATCH 14/20] fix styles with prettier --- .../settings/Security/CloseAccountPage.js | 65 +++++++++---------- 1 file changed, 31 insertions(+), 34 deletions(-) diff --git a/src/pages/settings/Security/CloseAccountPage.js b/src/pages/settings/Security/CloseAccountPage.js index 036fc5fe799b..7a64aa7eaccb 100644 --- a/src/pages/settings/Security/CloseAccountPage.js +++ b/src/pages/settings/Security/CloseAccountPage.js @@ -1,7 +1,4 @@ -import React, { - useState, - useEffect, -} from 'react'; +import React, {useState, useEffect} from 'react'; import {View} from 'react-native'; import {withOnyx} from 'react-native-onyx'; import PropTypes from 'prop-types'; @@ -40,7 +37,7 @@ const defaultProps = { }, }; -function CloseAccountPage (props) { +function CloseAccountPage(props) { const [isConfirmModalVisible, setConfirmModalVisibility] = useState(false); const [reasonForLeaving, setReasonForLeaving] = useState(''); @@ -90,35 +87,35 @@ function CloseAccountPage (props) { > {props.translate('closeAccountPage.reasonForLeavingPrompt')} - - - {props.translate('closeAccountPage.enterDefaultContactToConfirm')} {userEmailOrPhone}. - - - + + + {props.translate('closeAccountPage.enterDefaultContactToConfirm')} {userEmailOrPhone}. + + + From d5d59c2d50a4fad0408f0423ed19fe8b2c6a018c Mon Sep 17 00:00:00 2001 From: David Bondy Date: Fri, 2 Jun 2023 17:24:05 -0600 Subject: [PATCH 15/20] prevent execution of hook on every re-render by passing empty depedency array --- src/pages/settings/Security/CloseAccountPage.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pages/settings/Security/CloseAccountPage.js b/src/pages/settings/Security/CloseAccountPage.js index 7a64aa7eaccb..7d9fbe045566 100644 --- a/src/pages/settings/Security/CloseAccountPage.js +++ b/src/pages/settings/Security/CloseAccountPage.js @@ -41,7 +41,11 @@ function CloseAccountPage(props) { const [isConfirmModalVisible, setConfirmModalVisibility] = useState(false); const [reasonForLeaving, setReasonForLeaving] = useState(''); - useEffect(() => () => CloseAccount.clearError()); + // If you are new to hooks this might look weird but basically it is something that only runs when the component unmounts + // nothing runs on mount and we pass empty dependencies to prevent this from running on every re-render. + // TODO: We should refactor this so that the data in instead passed directly as a prop instead of "side loading" the data + // here, we left this as is during refactor to limit the breaking changes. + useEffect(() => () => CloseAccount.clearError(), []); const hideConfirmModal = () => { setConfirmModalVisibility(false); From d71f54b57814b7cbd4b5194d0de815a993a6d5aa Mon Sep 17 00:00:00 2001 From: David Bondy Date: Tue, 27 Jun 2023 09:52:30 -0600 Subject: [PATCH 16/20] apply changes from commit 38e49c372 --- src/pages/settings/Security/CloseAccountPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/Security/CloseAccountPage.js b/src/pages/settings/Security/CloseAccountPage.js index 11df367e5bcb..26d40565f548 100644 --- a/src/pages/settings/Security/CloseAccountPage.js +++ b/src/pages/settings/Security/CloseAccountPage.js @@ -117,7 +117,7 @@ function CloseAccountPage(props) { onCancel={hideConfirmModal} isVisible={isConfirmModalVisible} prompt={props.translate('closeAccountPage.closeAccountPermanentlyDeleteData')} - confirmText={props.translate('common.yes')} + confirmText={props.translate('common.yesContinue')} cancelText={props.translate('common.cancel')} shouldShowCancelButton /> From 57a33a47058e6fd1f6b7e34b9b7904bd9f9da724 Mon Sep 17 00:00:00 2001 From: David Bondy Date: Tue, 27 Jun 2023 09:54:31 -0600 Subject: [PATCH 17/20] pull in change from commit b2dda336 --- src/pages/settings/Security/CloseAccountPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/Security/CloseAccountPage.js b/src/pages/settings/Security/CloseAccountPage.js index 26d40565f548..23b752841833 100644 --- a/src/pages/settings/Security/CloseAccountPage.js +++ b/src/pages/settings/Security/CloseAccountPage.js @@ -109,7 +109,7 @@ function CloseAccountPage(props) { label={props.translate('closeAccountPage.enterDefaultContact')} containerStyles={[styles.mt5]} autoCorrect={false} - keyboardType={CONST.KEYBOARD_TYPE.EMAIL_ADDRESS} + keyboardType={Str.isValidEmail(userEmailOrPhone) ? CONST.KEYBOARD_TYPE.EMAIL_ADDRESS : CONST.KEYBOARD_TYPE.DEFAULT} /> Date: Tue, 27 Jun 2023 09:55:48 -0600 Subject: [PATCH 18/20] pull in changes from commit 1b36c75b17 --- src/pages/settings/Security/CloseAccountPage.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pages/settings/Security/CloseAccountPage.js b/src/pages/settings/Security/CloseAccountPage.js index 23b752841833..0eb5e30fc2dc 100644 --- a/src/pages/settings/Security/CloseAccountPage.js +++ b/src/pages/settings/Security/CloseAccountPage.js @@ -94,11 +94,10 @@ function CloseAccountPage(props) { {props.translate('closeAccountPage.reasonForLeavingPrompt')} {props.translate('closeAccountPage.enterDefaultContactToConfirm')} {userEmailOrPhone}. From 7bd01cbea52cbf080ccc03f7aeb2f4f1836c437d Mon Sep 17 00:00:00 2001 From: David Bondy Date: Tue, 27 Jun 2023 10:18:32 -0600 Subject: [PATCH 19/20] pull in changes from commit 3b5e279fe7 --- src/pages/settings/Security/CloseAccountPage.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pages/settings/Security/CloseAccountPage.js b/src/pages/settings/Security/CloseAccountPage.js index 0eb5e30fc2dc..daa400448ff7 100644 --- a/src/pages/settings/Security/CloseAccountPage.js +++ b/src/pages/settings/Security/CloseAccountPage.js @@ -76,11 +76,9 @@ function CloseAccountPage(props) { return ( - Navigation.navigate(ROUTES.SETTINGS_SECURITY)} - onCloseButtonPress={() => Navigation.dismissModal(true)} + onBackButtonPress={Navigation.goBack} />
Date: Tue, 27 Jun 2023 10:26:01 -0600 Subject: [PATCH 20/20] pull in changes from commit 1e456f6788d1d --- src/pages/settings/Security/CloseAccountPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/Security/CloseAccountPage.js b/src/pages/settings/Security/CloseAccountPage.js index daa400448ff7..8b99d16302b2 100644 --- a/src/pages/settings/Security/CloseAccountPage.js +++ b/src/pages/settings/Security/CloseAccountPage.js @@ -78,7 +78,7 @@ function CloseAccountPage(props) { Navigation.goBack(ROUTES.SETTINGS_SECURITY)} />