diff --git a/src/components/Onfido/index.css b/src/components/Onfido/index.css index 7e05cce7d49d..fba72e0139c1 100644 --- a/src/components/Onfido/index.css +++ b/src/components/Onfido/index.css @@ -47,3 +47,9 @@ height: 92% !important; } } + +.onfido-sdk-ui-NavigationBar-back { + /* This keeps onfido back button hidden since there is already a back button in the top header which + programatically clicks onfido button. */ + visibility: hidden; +} diff --git a/src/pages/ReimbursementAccount/RequestorOnfidoStep.js b/src/pages/ReimbursementAccount/RequestorOnfidoStep.js index 5d91f5dae562..f86cbaba79b0 100644 --- a/src/pages/ReimbursementAccount/RequestorOnfidoStep.js +++ b/src/pages/ReimbursementAccount/RequestorOnfidoStep.js @@ -31,6 +31,16 @@ class RequestorOnfidoStep extends React.Component { constructor(props) { super(props); this.submit = this.submit.bind(this); + this.goBack = this.goBack.bind(this); + } + + goBack() { + const onfidoBack = document.querySelector('.onfido-sdk-ui-NavigationBar-back'); + if (onfidoBack && !onfidoBack.classList.contains('onfido-sdk-ui-NavigationBar-disabled')) { + onfidoBack.click(); + } else { + this.props.onBackButtonPress(); + } } submit(onfidoData) { @@ -50,7 +60,7 @@ class RequestorOnfidoStep extends React.Component { stepCounter={{step: 3, total: 5}} shouldShowGetAssistanceButton guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_BANK_ACCOUNT} - onBackButtonPress={this.props.onBackButtonPress} + onBackButtonPress={this.goBack} />