Skip to content

Commit

Permalink
zaki / fix_withdrawals_page_mobile_cryptocashier (#1964)
Browse files Browse the repository at this point in the history
* fix: do not use setSideNote for mobile

* fix: check for desktop for setSideNotes
  • Loading branch information
zaki-hanafiah committed Oct 14, 2020
1 parent b0ed7b0 commit 09fde0e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/core/src/Modules/Cashier/Containers/withdrawal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import PropTypes from 'prop-types';
import React from 'react';
import { connect } from 'Stores/connect';
import { Localize } from '@deriv/translations';
import { isDesktop } from '@deriv/shared';
import Withdraw from '../Components/withdraw.jsx';
import SendEmail from '../Components/Email/send-email.jsx';
import Error from '../Components/Error/error.jsx';
Expand Down Expand Up @@ -53,17 +54,17 @@ const Withdrawal = ({
return () => {
setErrorMessage('');
};
}, []);
}, [container, setActiveTab, setErrorMessage]);

React.useEffect(() => {
if (iframe_url || verification_code) {
if ((iframe_url || verification_code) && isDesktop()) {
if (/^(UST|eUSDT)$/i.test(currency) && typeof setSideNotes === 'function') {
setSideNotes([<WithdrawalSideNote key={0} />, <USDTSideNote key={1} />]);
} else {
setSideNotes([<WithdrawalSideNote key={0} />]);
}
}
}, [iframe_url, verification_code]);
}, [currency, setSideNotes, iframe_url, verification_code]);

if (verification_code || iframe_url) {
return <Withdraw />;
Expand Down

0 comments on commit 09fde0e

Please sign in to comment.