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

Commit

Permalink
change redirection url
Browse files Browse the repository at this point in the history
  • Loading branch information
mahdiyeh-deriv committed Dec 5, 2021
1 parent e944925 commit a8828c2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/common/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,14 @@ function getBinaryUrl(page) {
return binary_url;
}

function getBinaryUrlWithoutLng(page) {
var hostname = new URL(window.location.href).hostname;
var domain = hostname.includes('binary.me') ? '.me' : '.com';
var binary_url = 'https://binary' + domain + '/' + page;

return binary_url;
}

function getDerivUrl(page) {
var hostname = new URL(window.location.href).hostname;
var lang = (local_storage.get('i18n') || {value: 'en'}).value;
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function processRedirect(selected_language_name) {
}
}
if ((!isEuCountrySelected(ip_country) && has_mf) || (isEuCountrySelected(residence_country) && account_list.length == 1)){
window.location.href = getBinaryUrl('move-to-deriv')
window.location.href = getBinaryUrlWithoutLng('move-to-deriv')
} else {
window.location.href = VERSION + 'main.html';
}
Expand All @@ -101,9 +101,10 @@ function processRedirect(selected_language_name) {
}
function processPageLanguage() {
populateLanguageDropdown();
var selected_language_name = (window.local_storage.get('i18n') || { value: 'en' }).value;

if (local_storage.get('oauth')) {
processRedirect();
processRedirect(selected_language_name);
} else {
document.getElementById('loading_container').style.display="none"
document.getElementById('main_container').style.display="block"
Expand All @@ -112,7 +113,6 @@ function processPageLanguage() {
setTime();
setInterval(setTime, 1000);

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

0 comments on commit a8828c2

Please sign in to comment.