Skip to content

Commit

Permalink
Ameerul /PRODQA 1240 Cashier is blank when client is in P2P cashier a…
Browse files Browse the repository at this point in the history
…nd switching from Fiat to Crypto (binary-com#9544)

* chore: fixed switching account issue from p2p tab

* chore: changed if else statement
  • Loading branch information
ameerul-deriv committed Aug 9, 2023
1 parent 7c36cd5 commit ae6293d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/cashier/src/containers/cashier/cashier.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,13 @@ 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) {
if (
(is_p2p_enabled_success && !is_p2p_enabled && history.location.pathname === routes.cashier_p2p) ||
(tab_index === 0 && !is_p2p_enabled)
) {
history.push(routes.cashier_deposit);
}
}, [history, is_p2p_enabled, is_p2p_enabled_success]);
}, [history, is_p2p_enabled, is_p2p_enabled_success, tab_index]);

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

0 comments on commit ae6293d

Please sign in to comment.