File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -40,16 +40,16 @@ const Layout = () => {
40
40
const validateApiAccounts = ( { data } : any ) => {
41
41
if ( data . msg_type === 'authorize' ) {
42
42
const enabled_accounts = ( data . authorize . account_list || [ ] ) . filter ( ( acc : any ) => ! acc . is_disabled ) ;
43
- api_accounts . push ( enabled_accounts ) ;
43
+ api_accounts . push ( enabled_accounts || [ ] ) ;
44
44
45
45
const allCurrencies = new Set ( Object . values ( checkClientAccount ) . map ( acc => acc . currency ) ) ;
46
46
let currency = 'USD' ;
47
- const hasMissingCurrency = enabled_accounts . some ( account => {
48
- if ( ! allCurrencies . has ( account . currency ) ) {
47
+ const hasMissingCurrency = api_accounts ?. flat ( ) . some ( data => {
48
+ if ( ! allCurrencies . has ( data . currency ) ) {
49
49
sessionStorage . setItem ( 'query_param_currency' , currency ) ;
50
50
return true ;
51
51
}
52
- currency = account . currency ;
52
+ currency = data . currency ;
53
53
return false ;
54
54
} ) ;
55
55
You can’t perform that action at this time.
0 commit comments