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

Meenu:/ Redirect row users to move-to-deriv and setup cookies #3622

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions src/common/utils/cookieManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,14 @@ export const setCookieLanguage = lang => {
cookie.write(lang.toUpperCase(), undefined, true, 'none');
}
};

export const setCookieBinary = () => {
if (!Cookies.get('binary-com')) {
window.location.replace('https://binary.bot/move-to-deriv');
} else {
Cookies.set('binary-com', true, {
expires: 15,
});
window.location.replace('https://binary.com');
}
};
6 changes: 6 additions & 0 deletions src/common/utils/utility.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { generateLiveApiInstance } from '../../common/appId';
import { getTokenList } from '../../common/utils/storageManager';
import { setCookieBinary } from '../../common/utils/cookieManager';

const euCountries = [
'it',
Expand Down Expand Up @@ -46,6 +47,11 @@ export const moveToDeriv = async () => {
if (isEuCountry(clients_country) || isUKCountry(clients_country)) {
window.location.replace('https://binary.com/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.

}
// redirect ROW clients to move-to-deriv by default
else {
window.location.replace('https://binary.bot/move-to-deriv');
setCookieBinary();
}
}

if (
Expand Down