This repository was archived by the owner on Feb 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
src/javascript/app/common Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change
1
+ const Cookies = require ( 'js-cookie' ) ;
1
2
const DerivBanner = require ( './deriv_banner' ) ;
2
3
const BinarySocket = require ( '../base/socket' ) ;
3
4
const State = require ( '../../_common/storage' ) . State ;
@@ -12,14 +13,31 @@ const RedirectBanner = (() => {
12
13
const eu_country = isEuCountrySelected ( Client . get ( 'residence' ) ) || isEuCountrySelected ( State . getResponse ( 'website_status.clients_country' ) ) ;
13
14
if ( eu_country ) {
14
15
handleRedirect ( ) ;
16
+ } else {
17
+ handleRedirectROW ( ) ;
15
18
}
16
19
17
20
} ) ;
18
21
19
22
} ;
20
23
21
24
const handleRedirect = ( ) => {
22
- window . location . href = '/move-to-deriv/' ;
25
+ window . location . href = 'https://www.binary.bot/movetoderiv.html' ;
26
+
27
+ } ;
28
+
29
+ const handleRedirectROW = ( ) => {
30
+
31
+ // Check if param have ?binary-com-lp
32
+ const redirectBinary = new URLSearchParams ( window . location . search ) ;
33
+
34
+ if ( redirectBinary . has ( 'binary-com-lp' ) || Cookies . get ( 'binary-com-show' ) ) {
35
+ // Set cookie if they wanted to stay at binary.com and no redirect
36
+ Cookies . set ( 'binary-com-show' , true , { expires : 7 } ) ;
37
+ } else {
38
+ window . location . replace ( 'https://www.binary.bot/movetoderiv.html' ) ;
39
+ }
40
+
23
41
} ;
24
42
25
43
const loginOnLoad = ( ) => {
You can’t perform that action at this time.
0 commit comments