@@ -59,14 +59,14 @@ function App() {
5959 } ;
6060 } , [ ] ) ;
6161
62- // const updateAccountParamInURL = (account_data: TAuthData['account_list'][number], fallback_currency = '') => {
63- // const search_params = new URLSearchParams(window.location.search);
64- // const account_param = account_data.loginid.startsWith('VR')
65- // ? 'demo'
66- // : account_data.currency || fallback_currency;
67- // search_params.set('account', account_param);
68- // window.history.pushState({}, '', `${window.location.pathname}?${search_params.toString()}`);
69- // };
62+ const updateAccountParamInURL = ( account_data : TAuthData [ 'account_list' ] [ number ] , fallback_currency = '' ) => {
63+ const search_params = new URLSearchParams ( window . location . search ) ;
64+ const account_param = account_data . loginid . startsWith ( 'VR' )
65+ ? 'demo'
66+ : account_data . currency || fallback_currency ;
67+ search_params . set ( 'account' , account_param ) ;
68+ window . history . pushState ( { } , '' , `${ window . location . pathname } ?${ search_params . toString ( ) } ` ) ;
69+ } ;
7070
7171 React . useEffect ( ( ) => {
7272 const accounts_list = localStorage . getItem ( 'accountsList' ) ;
@@ -85,7 +85,7 @@ function App() {
8585 ) ;
8686 if ( ! selected_account ) return ;
8787 const [ /* eslint-disable-line @typescript-eslint/no-unused-vars */ _ , account ] = selected_account ;
88- // updateAccountParamInURL(account);
88+ updateAccountParamInURL ( account ) ;
8989 } catch ( e ) {
9090 console . warn ( 'Error' , e ) ; // eslint-disable-line no-console
9191 }
@@ -142,7 +142,7 @@ function App() {
142142 ) ;
143143 if ( ! selected_account ) return ;
144144 const [ _ , account ] = selected_account ; // eslint-disable-line @typescript-eslint/no-unused-vars
145- // updateAccountParamInURL(account, 'USD');
145+ updateAccountParamInURL ( account , 'USD' ) ;
146146 }
147147 } catch ( e ) {
148148 console . warn ( 'Error' , e ) ; // eslint-disable-line no-console
0 commit comments