@@ -29,7 +29,7 @@ const Layout = () => {
29
29
Object . values ( checkClientAccount ) . some ( account => account . currency === currency ) ||
30
30
currency === 'demo' ||
31
31
currency === '' ;
32
- const [ clientHasCurrency , setClientHasCurrency ] = useState ( ifClientAccountHasCurrency ) ;
32
+ const [ clientHasCurrency ] = useState ( ifClientAccountHasCurrency ) ;
33
33
34
34
const validCurrencies = [ ...fiat_currencies_display_order , ...crypto_currencies_display_order ] ;
35
35
const query_currency = ( getQueryParams . get ( 'account' ) ?? '' ) ?. toUpperCase ( ) ;
@@ -40,11 +40,17 @@ const Layout = () => {
40
40
const validateApiAccounts = ( { data } : any ) => {
41
41
if ( data . msg_type === 'authorize' ) {
42
42
api_accounts . push ( data . authorize . account_list || [ ] ) ;
43
+ console . log ( 'api_accounts' , api_accounts ) ;
44
+ console . log ( 'checkClientAccount' , checkClientAccount ) ;
43
45
api_accounts ?. flat ( ) . map ( data => {
44
46
Object . values ( checkClientAccount ) . map ( key => {
47
+ console . log ( 'outside data.currency' , data . currency ) ;
48
+ console . log ( 'outside key.currency' , key . currency ) ;
45
49
if ( data . currency !== key . currency ) {
46
50
console . log ( 'setClientHasCurrency' ) ;
47
- setClientHasCurrency ( false ) ;
51
+ console . log ( 'data.currency' , data . currency ) ;
52
+ console . log ( 'key.currency' , key . currency ) ;
53
+ //setClientHasCurrency(false);
48
54
}
49
55
} ) ;
50
56
} ) ;
@@ -62,11 +68,10 @@ const Layout = () => {
62
68
}
63
69
} , [ ] ) ;
64
70
71
+ console . log ( 'clientHasCurrency' , clientHasCurrency ) ;
72
+
65
73
useEffect ( ( ) => {
66
- if (
67
- ( isLoggedInCookie && ! isClientAccountsPopulated && isOAuth2Enabled && ! isEndpointPage && ! isCallbackPage ) ||
68
- ! clientHasCurrency
69
- ) {
74
+ if ( isLoggedInCookie && ! isClientAccountsPopulated && isOAuth2Enabled && ! isEndpointPage && ! isCallbackPage ) {
70
75
console . log ( 'requestOidcAuthentication' ) ;
71
76
requestOidcAuthentication ( {
72
77
redirectCallbackUri : `${ window . location . origin } /callback` ,
0 commit comments