Skip to content

Commit

Permalink
Fixed reviewer comments, fix hook call issue
Browse files Browse the repository at this point in the history
  • Loading branch information
makiour committed Aug 22, 2023
1 parent 811c923 commit 964bb58
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/pages/settings/Wallet/AddDebitCardPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ const propTypes = {
formData: PropTypes.shape({
setupComplete: PropTypes.bool,
}),

/** List of betas available to current user */
betas: PropTypes.arrayOf(PropTypes.string),
};

Expand All @@ -39,9 +41,6 @@ const defaultProps = {
};

function DebitCardPage(props) {
if (!Permissions.canUseWallet(props.betas)) {
return <NotFoundPage />;
}
const {translate} = useLocalize();
const prevFormDataSetupComplete = usePrevious(props.formData.setupComplete);
const nameOnCardRef = useRef(null);
Expand Down Expand Up @@ -101,6 +100,10 @@ function DebitCardPage(props) {
return errors;
};

if (!Permissions.canUseWallet(props.betas)) {
return <NotFoundPage />;
}

return (
<ScreenWrapper
onEntryTransitionEnd={() => nameOnCardRef.current && nameOnCardRef.current.focus()}
Expand Down

0 comments on commit 964bb58

Please sign in to comment.