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

Meenu/updated url for binary to deriv row users #7206

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion src/javascript/app/common/redirect_banner.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const Cookies = require('js-cookie');
const DerivBanner = require('./deriv_banner');
const BinarySocket = require('../base/socket');
const State = require('../../_common/storage').State;
Expand All @@ -12,14 +13,30 @@ const RedirectBanner = (() => {
const eu_country = isEuCountrySelected(Client.get('residence')) || isEuCountrySelected(State.getResponse('website_status.clients_country'));
if (eu_country) {
handleRedirect();
} else {
handleRedirectROW();
}

});

};

const handleRedirect = () => {
window.location.href = '/move-to-deriv/';
window.location.href = 'https://www.binary.bot/movetoderiv.html';
Copy link
Contributor

Choose a reason for hiding this comment

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

/move-to-deriv/

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @habib-deriv @meenakshi-deriv the new one is /binary-to-deriv/ which we need to append to the url. We won’t need any redirection I think. 🤔

binary.com/binary-to-deriv/

};
const handleRedirectROW = () => {

// Check if param have ?binary-com-lp
const redirectBinary = new URLSearchParams(window.location.search);

if (redirectBinary.has('binary-com-lp') || Cookies.get('binary-com-show')){
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we don’t need this binary-com-lp check here anymore cause the changes will be in binary itself now.
We just need to append /binary-to-deriv/ once the client country is rest of the world.

@habib-deriv please correct me if I'm wrong 🙏

// Set cookie if they wanted to stay at binary.com and no redirect
Cookies.set('binary-com-show', true, { expires: 7 });
} else {
window.location.replace('https://www.binary.bot/movetoderiv.html');
}

window.location.href = '/binary-to-deriv/';
};

const loginOnLoad = () => {
Expand Down