Skip to content

Commit 4928bb2

Browse files
committed
fix: currency param
1 parent f02c8ea commit 4928bb2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/pages/callback/callback-page.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,13 @@ const CallbackPage = () => {
5757
.filter(key => key.startsWith('cur'))
5858
.map(key => tokens[key]);
5959
const is_valid_currency = currencies.includes(state?.account || currency || '');
60-
const selected_currency = is_valid_currency ? state?.account || currency : 'USD';
60+
61+
const firstAccountKey = Object.keys(clientAccounts)[0];
62+
const firstAccountCurrency = clientAccounts[tokens.acct1]
63+
? clientAccounts[firstAccountKey].currency
64+
: null;
65+
const selected_currency =
66+
(is_valid_currency ? state?.account?.currency || currency : currency) || firstAccountCurrency;
6167
window.location.assign(`/?account=${selected_currency}`);
6268
}}
6369
renderReturnButton={() => {

0 commit comments

Comments
 (0)