File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
external/bot-skeleton/services/api Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -39,15 +39,17 @@ const Layout = () => {
39
39
40
40
const validateApiAccounts = ( { data } : any ) => {
41
41
if ( data . msg_type === 'authorize' ) {
42
- api_accounts . push ( data . authorize . account_list || [ ] ) ;
42
+ const enabled_accounts = ( data . authorize . account_list || [ ] ) . filter ( ( acc : any ) => ! acc . is_disabled ) ;
43
+ api_accounts . push ( enabled_accounts ) ;
44
+
43
45
const allCurrencies = new Set ( Object . values ( checkClientAccount ) . map ( acc => acc . currency ) ) ;
44
46
let currency = 'USD' ;
45
- const hasMissingCurrency = api_accounts ?. flat ( ) . some ( data => {
46
- if ( ! allCurrencies . has ( data . currency ) ) {
47
+ const hasMissingCurrency = enabled_accounts . some ( account => {
48
+ if ( ! allCurrencies . has ( account . currency ) ) {
47
49
sessionStorage . setItem ( 'query_param_currency' , currency ) ;
48
50
return true ;
49
51
}
50
- currency = data . currency ;
52
+ currency = account . currency ;
51
53
return false ;
52
54
} ) ;
53
55
@@ -59,7 +61,7 @@ const Layout = () => {
59
61
}
60
62
61
63
if ( subscription ) {
62
- subscription ? .unsubscribe ( ) ;
64
+ subscription . unsubscribe ( ) ;
63
65
}
64
66
}
65
67
} ;
Original file line number Diff line number Diff line change @@ -171,7 +171,8 @@ class APIBase {
171
171
this . active_symbols_promise = this . getActiveSymbols ( ) ;
172
172
}
173
173
this . account_info = authorize ;
174
- setAccountList ( authorize . account_list ) ;
174
+ const filtered_accounts = ( authorize ?. account_list || [ ] ) . filter ( acc => ! acc ?. is_disabled ) ;
175
+ setAccountList ( filtered_accounts ) ;
175
176
setAuthData ( authorize ) ;
176
177
setIsAuthorized ( true ) ;
177
178
this . is_authorized = true ;
You can’t perform that action at this time.
0 commit comments