File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,19 @@ const CallbackPage = () => {
57
57
. filter ( key => key . startsWith ( 'cur' ) )
58
58
. map ( key => tokens [ key ] ) ;
59
59
const is_valid_currency = currencies . includes ( state ?. account || currency || '' ) ;
60
- const selected_currency = is_valid_currency ? state ?. account || currency : 'USD' ;
60
+
61
+ const firstAccountKey = tokens . acct1 ;
62
+ const firstAccountCurrency = clientAccounts [ firstAccountKey ]
63
+ ? clientAccounts [ firstAccountKey ] . currency
64
+ : null ;
65
+ const selected_currency =
66
+ ( is_valid_currency ? state ?. account ?. currency || currency : currency ) || firstAccountCurrency ;
67
+ console . log ( 'selected_currency' , {
68
+ firstAccountCurrency,
69
+ stateAccountCurrency : state ?. account ?. currency ,
70
+ currency,
71
+ selected_currency,
72
+ } ) ;
61
73
window . location . assign ( `/?account=${ selected_currency } ` ) ;
62
74
} }
63
75
renderReturnButton = { ( ) => {
You can’t perform that action at this time.
0 commit comments