Skip to content

Commit

Permalink
fix(wallets): 🚑 fix ctrader webterminal link (#17778)
Browse files Browse the repository at this point in the history
  • Loading branch information
heorhi-deriv authored Dec 11, 2024
1 parent d8a54db commit c761926
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ const MT5TradeLink: FC<TMT5TradeLinkProps> = ({ app = 'linux', isDemo = false, m
url = isDemo ? dxtradeLinks.demo : dxtradeLinks.live;
break;
case CFD_PLATFORMS.CTRADER:
await getCtraderToken().then(res => {
ctraderToken = res?.service_token?.ctrader?.token;
});
ctraderURL = isTestLink || isStaging ? ctraderLinks.staging : ctraderLinks.live;
if (ctraderToken) {
url = `${ctraderURL}/?token=${ctraderToken}`;
} else {
url = ctraderURL;
try {
const { service_token: serviceToken } = await getCtraderToken();
ctraderToken = serviceToken?.ctrader?.token;
} catch (error) {
/* eslint-disable no-console */
console.error('Failed to fetch cTrader token:', error);
}
url = ctraderToken ? `${ctraderURL}/?token=${ctraderToken}` : ctraderURL;
break;
default:
url = '';
Expand Down

0 comments on commit c761926

Please sign in to comment.