@@ -28,7 +28,7 @@ import {
2828 addTokenIfValid ,
2929} from '../../common/appId' ;
3030import { translate } from '../../common/i18n' ;
31- import isEuCountry , { showHideEuElements } from '../../common/footer-checks' ;
31+ import { isEuCountry , showHideEuElements , hasEuAccount } from '../../common/footer-checks' ;
3232import googleDrive from '../../common/integrations/GoogleDrive' ;
3333import { getLanguage } from '../../common/lang' ;
3434import { observer as globalObserver } from '../../common/utils/observer' ;
@@ -187,6 +187,9 @@ const updateTokenList = () => {
187187 loginButton . show ( ) ;
188188 accountList . hide ( ) ;
189189
190+ // If logged out, determine EU based on IP.
191+ isEuCountry ( api ) . then ( isEu => showHideEuElements ( isEu ) ) ;
192+
190193 $ ( '.account-id' )
191194 . removeAttr ( 'value' )
192195 . text ( '' ) ;
@@ -197,13 +200,17 @@ const updateTokenList = () => {
197200 } else {
198201 loginButton . hide ( ) ;
199202 accountList . show ( ) ;
203+
200204 const activeToken = getActiveToken ( tokenList , getStorage ( AppConstants . STORAGE_ACTIVE_TOKEN ) ) ;
205+ showHideEuElements ( hasEuAccount ( tokenList ) ) ;
201206 updateLogo ( activeToken . token ) ;
202207 addBalanceForToken ( activeToken . token ) ;
208+
203209 if ( ! ( 'loginInfo' in activeToken ) ) {
204210 removeAllTokens ( ) ;
205211 updateTokenList ( ) ;
206212 }
213+
207214 tokenList . forEach ( tokenInfo => {
208215 const prefix = isVirtual ( tokenInfo ) ? 'Virtual Account' : `${ tokenInfo . loginInfo . currency } Account` ;
209216 if ( tokenInfo === activeToken ) {
@@ -234,7 +241,7 @@ export default class View {
234241 constructor ( ) {
235242 logHandler ( ) ;
236243 this . initPromise = new Promise ( resolve => {
237- updateConfigCurrencies ( ) . then ( ( ) => {
244+ updateConfigCurrencies ( api ) . then ( ( ) => {
238245 symbolPromise . then ( ( ) => {
239246 updateTokenList ( ) ;
240247 this . blockly = new _Blockly ( ) ;
@@ -727,7 +734,6 @@ function initRealityCheck(stopCallback) {
727734 ) ;
728735}
729736function renderReactComponents ( ) {
730- isEuCountry ( ) . then ( isEu => showHideEuElements ( isEu ) ) ;
731737 ReactDOM . render ( < ServerTime api = { api } /> , $ ( '#server-time' ) [ 0 ] ) ;
732738 ReactDOM . render ( < Tour /> , $ ( '#tour' ) [ 0 ] ) ;
733739 ReactDOM . render (
0 commit comments