Skip to content

Commit

Permalink
fix: issue with routing to deposit page on any tab selection in cashi…
Browse files Browse the repository at this point in the history
  • Loading branch information
nada-deriv authored Aug 10, 2023
1 parent 7e162a1 commit 381d126
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/cashier/src/containers/cashier/cashier.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,10 @@ const Cashier = observer(({ history, location, routes: routes_config }: TCashier
}, [history, is_payment_agent_transfer_visible, is_payment_agent_transfer_visible_is_success]);

React.useEffect(() => {
if (
(is_p2p_enabled_success && !is_p2p_enabled && history.location.pathname === routes.cashier_p2p) ||
(tab_index === 0 && !is_p2p_enabled)
) {
if (is_p2p_enabled_success && !is_p2p_enabled && history.location.pathname.startsWith(routes.cashier_p2p)) {
history.push(routes.cashier_deposit);
}
}, [history, is_p2p_enabled, is_p2p_enabled_success, tab_index]);
}, [history, is_p2p_enabled, is_p2p_enabled_success]);

const onClickClose = () => history.push(routes.traders_hub);
const getMenuOptions = () => {
Expand Down

0 comments on commit 381d126

Please sign in to comment.