Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit a8828c2

Browse files
change redirection url
1 parent e944925 commit a8828c2

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/common/util.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,14 @@ function getBinaryUrl(page) {
517517
return binary_url;
518518
}
519519

520+
function getBinaryUrlWithoutLng(page) {
521+
var hostname = new URL(window.location.href).hostname;
522+
var domain = hostname.includes('binary.me') ? '.me' : '.com';
523+
var binary_url = 'https://binary' + domain + '/' + page;
524+
525+
return binary_url;
526+
}
527+
520528
function getDerivUrl(page) {
521529
var hostname = new URL(window.location.href).hostname;
522530
var lang = (local_storage.get('i18n') || {value: 'en'}).value;

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function processRedirect(selected_language_name) {
9090
}
9191
}
9292
if ((!isEuCountrySelected(ip_country) && has_mf) || (isEuCountrySelected(residence_country) && account_list.length == 1)){
93-
window.location.href = getBinaryUrl('move-to-deriv')
93+
window.location.href = getBinaryUrlWithoutLng('move-to-deriv')
9494
} else {
9595
window.location.href = VERSION + 'main.html';
9696
}
@@ -101,9 +101,10 @@ function processRedirect(selected_language_name) {
101101
}
102102
function processPageLanguage() {
103103
populateLanguageDropdown();
104+
var selected_language_name = (window.local_storage.get('i18n') || { value: 'en' }).value;
104105

105106
if (local_storage.get('oauth')) {
106-
processRedirect();
107+
processRedirect(selected_language_name);
107108
} else {
108109
document.getElementById('loading_container').style.display="none"
109110
document.getElementById('main_container').style.display="block"
@@ -112,7 +113,6 @@ function processPageLanguage() {
112113
setTime();
113114
setInterval(setTime, 1000);
114115

115-
var selected_language_name = (window.local_storage.get('i18n') || { value: 'en' }).value;
116116
$.getJSON(VERSION + 'i18n/' + selected_language_name + '.json', function (data) {
117117
setupi18nTranslation(data);
118118
processFooter(selected_language_name);

0 commit comments

Comments
 (0)