Skip to content

Commit

Permalink
Revert "Hirad: adding deep-linking" (#13121)
Browse files Browse the repository at this point in the history
  • Loading branch information
hirad-deriv authored Jan 24, 2024
1 parent c9b2083 commit 796e4f0
Showing 1 changed file with 3 additions and 31 deletions.
34 changes: 3 additions & 31 deletions packages/cfd/src/Containers/dmt5-trade-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
getPlatformSettings,
getUrlBase,
MT5_ACCOUNT_STATUS,
mobileOSDetect,
} from '@deriv/shared';
import { observer, useStore } from '@deriv/stores';
import { Localize, localize } from '@deriv/translations';
Expand Down Expand Up @@ -63,28 +62,6 @@ const DMT5TradeModal = observer(
return undefined;
};

const getMobileAppInstallerURL = () => {
if (mobileOSDetect() === 'iOS') {
return getPlatformMt5DownloadLink('ios');
} else if (/huawei/i.test(navigator.userAgent)) {
return getPlatformMt5DownloadLink('huawei');
}
return getPlatformMt5DownloadLink('android');
};

let mobile_url;
const mobileURLSet = () => {
mobile_url = window.location.replace(deepLink);
const timeout = setTimeout(() => {
mobile_url = window.location.replace(getMobileAppInstallerURL());
}, 3000);
if (!/safari/i.test(navigator.userAgent)) {
window.onblur = () => {
clearTimeout(timeout);
};
}
};

const getHeadingTitle = () =>
getCFDAccountDisplay({
market_type: mt5_trade_account.market_type,
Expand Down Expand Up @@ -117,10 +94,6 @@ const DMT5TradeModal = observer(
MT5_ACCOUNT_STATUS.MIGRATED_WITHOUT_POSITION,
].includes(mt5_trade_account?.status);

const deepLink = `metatrader5://account?login=${
(mt5_trade_account as TTradingPlatformAccounts)?.display_login
}&server=${(mt5_trade_account as DetailsOfEachMT5Loginid)?.server_info?.environment}`;

return (
<div className='cfd-trade-modal-container'>
<div className='cfd-trade-modal'>
Expand Down Expand Up @@ -222,10 +195,9 @@ const DMT5TradeModal = observer(
<a
className='dc-btn cfd-trade-modal__download-center-app--option-link'
type='button'
onClick={is_mobile ? mobileURLSet : undefined}
href={is_mobile ? mobile_url : mt5_trade_account.webtrader_url}
target={is_mobile ? '' : '_blank'}
rel={is_mobile ? '' : 'noopener noreferrer'}
href={mt5_trade_account.webtrader_url}
target='_blank'
rel='noopener noreferrer'
>
<Text size='xxs' weight='bold' color='prominent'>
{localize('Open')}
Expand Down

1 comment on commit 796e4f0

@vercel
Copy link

@vercel vercel bot commented on 796e4f0 Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

deriv-app – ./

deriv-app.vercel.app
binary.sx
deriv-app.binary.sx
deriv-app-git-master.binary.sx

Please sign in to comment.