From 91dac266ed8a2afbb44ff053507b85578cfe3920 Mon Sep 17 00:00:00 2001 From: Meenakshi Date: Wed, 3 Aug 2022 13:31:30 +0400 Subject: [PATCH 1/3] redirect row users --- src/javascript/app/common/redirect_banner.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/javascript/app/common/redirect_banner.js b/src/javascript/app/common/redirect_banner.js index c3144c413e043..ddc50a2e79828 100644 --- a/src/javascript/app/common/redirect_banner.js +++ b/src/javascript/app/common/redirect_banner.js @@ -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; @@ -12,6 +13,8 @@ const RedirectBanner = (() => { const eu_country = isEuCountrySelected(Client.get('residence')) || isEuCountrySelected(State.getResponse('website_status.clients_country')); if (eu_country) { handleRedirect(); + } else { + handleRedirectROW(); } }); @@ -20,6 +23,23 @@ const RedirectBanner = (() => { const handleRedirect = () => { window.location.href = '/move-to-deriv/'; + + }; + + const handleRedirectROW = () => { + + // Check if param have ?binary-com-lp + const redirectBinary = new URLSearchParams(window.location.search); + const date = new Date(); + date.setTime(date.getTime()+(2*60*1000)); + + if (redirectBinary.has('binary-com-lp') || Cookies.get('binary-com-show')){ + // Set cookie if they wanted to stay at binary.com and no redirect + Cookies.set('binary-com-show', true, { expires: date }); + } else { + window.location.replace('https://binary.bot/move-to-deriv'); + } + }; const loginOnLoad = () => { From a8904a7ef8dace742421b3bda408dbf4aa866082 Mon Sep 17 00:00:00 2001 From: Meenakshi Date: Wed, 3 Aug 2022 14:28:46 +0400 Subject: [PATCH 2/3] fixed errors --- src/javascript/app/common/redirect_banner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/javascript/app/common/redirect_banner.js b/src/javascript/app/common/redirect_banner.js index ddc50a2e79828..5821a2d6326a6 100644 --- a/src/javascript/app/common/redirect_banner.js +++ b/src/javascript/app/common/redirect_banner.js @@ -31,7 +31,7 @@ const RedirectBanner = (() => { // Check if param have ?binary-com-lp const redirectBinary = new URLSearchParams(window.location.search); const date = new Date(); - date.setTime(date.getTime()+(2*60*1000)); + date.setTime(date.getTime() + (2 * 60 * 1000)); if (redirectBinary.has('binary-com-lp') || Cookies.get('binary-com-show')){ // Set cookie if they wanted to stay at binary.com and no redirect From 64c625f4e1e1097e9e78639e38861b8e2120ec38 Mon Sep 17 00:00:00 2001 From: Meenakshi Date: Tue, 9 Aug 2022 10:29:25 +0400 Subject: [PATCH 3/3] updated redirect url and cookies --- src/javascript/app/common/redirect_banner.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/javascript/app/common/redirect_banner.js b/src/javascript/app/common/redirect_banner.js index 5821a2d6326a6..70b090909fe8f 100644 --- a/src/javascript/app/common/redirect_banner.js +++ b/src/javascript/app/common/redirect_banner.js @@ -22,7 +22,7 @@ const RedirectBanner = (() => { }; const handleRedirect = () => { - window.location.href = '/move-to-deriv/'; + window.location.href = 'https://www.binary.bot/movetoderiv.html'; }; @@ -30,14 +30,12 @@ const RedirectBanner = (() => { // Check if param have ?binary-com-lp const redirectBinary = new URLSearchParams(window.location.search); - const date = new Date(); - date.setTime(date.getTime() + (2 * 60 * 1000)); if (redirectBinary.has('binary-com-lp') || Cookies.get('binary-com-show')){ // Set cookie if they wanted to stay at binary.com and no redirect - Cookies.set('binary-com-show', true, { expires: date }); + Cookies.set('binary-com-show', true, { expires: 7 }); } else { - window.location.replace('https://binary.bot/move-to-deriv'); + window.location.replace('https://www.binary.bot/movetoderiv.html'); } };