Skip to content

Commit

Permalink
Merge pull request #282 from rupato-deriv/fix--oidc-search-params
Browse files Browse the repository at this point in the history
fix: fix search param check
  • Loading branch information
rupato-deriv authored Feb 18, 2025
2 parents dc97ffc + 35e4e08 commit dd15883
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ function App() {
};
}, []);

const updateAccountParamInURL = (account_data: TAuthData['account_list'][number], fallback_currency = '') => {
const search_params = new URLSearchParams(window.location.search);
const account_param = account_data.loginid.startsWith('VR')
? 'demo'
: account_data.currency || fallback_currency;
search_params.set('account', account_param);
window.history.pushState({}, '', `${window.location.pathname}?${search_params.toString()}`);
};
// const updateAccountParamInURL = (account_data: TAuthData['account_list'][number], fallback_currency = '') => {
// const search_params = new URLSearchParams(window.location.search);
// const account_param = account_data.loginid.startsWith('VR')
// ? 'demo'
// : account_data.currency || fallback_currency;
// search_params.set('account', account_param);
// //window.history.pushState({}, '', `${window.location.pathname}?${search_params.toString()}`);
// };

React.useEffect(() => {
const accounts_list = localStorage.getItem('accountsList');
Expand All @@ -85,7 +85,7 @@ function App() {
);
if (!selected_account) return;
const [/* eslint-disable-line @typescript-eslint/no-unused-vars */ _, account] = selected_account;
updateAccountParamInURL(account);
//updateAccountParamInURL(account);
} catch (e) {
console.warn('Error', e); // eslint-disable-line no-console
}
Expand Down Expand Up @@ -142,7 +142,7 @@ function App() {
);
if (!selected_account) return;
const [_, account] = selected_account; // eslint-disable-line @typescript-eslint/no-unused-vars
updateAccountParamInURL(account, 'USD');
//updateAccountParamInURL(account, 'USD');
}
} catch (e) {
console.warn('Error', e); // eslint-disable-line no-console
Expand Down

0 comments on commit dd15883

Please sign in to comment.