Skip to content

Commit

Permalink
fix infinite loop cause by redirecting to bank account set
Browse files Browse the repository at this point in the history
  • Loading branch information
mollfpr committed Mar 14, 2022
1 parent e206e91 commit 173d234
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pages/workspace/WorkspaceBankAccountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ class WorkspaceBankAccountPage extends React.Component {

componentDidMount() {
this.unsubscribe = this.props.navigation.addListener('focus', this.onScreenFocus);

if (!this.getShouldShowPage()) {
this.navigateToBankAccountRoute();
}
}

componentWillUnmount() {
Expand Down Expand Up @@ -89,10 +93,6 @@ class WorkspaceBankAccountPage extends React.Component {
}

render() {
if (!this.getShouldShowPage()) {
this.navigateToBankAccountRoute();
return null;
}
const policyName = lodashGet(this.props.policy, 'name');

return (
Expand Down

0 comments on commit 173d234

Please sign in to comment.