@ -17,7 +17,7 @@ import BigNumber from 'bignumber.js';
import { initialState } from '../reducers/SendFormReducer' ;
import { findAccount } from '../reducers/AccountsReducer' ;
import { findToken } from '../reducers/TokensReducer' ;
import { findSelectedDevice } from '../reducers/TrezorConnectReducer' ;
import { findSelectedDevice , findDevice } from '../reducers/TrezorConnectReducer' ;
import type {
Dispatch ,
@ -269,10 +269,13 @@ export const validation = (): ThunkAction => {
// corner-case: when same derivation path is used on different networks
const currentNetworkAccount = savedAccounts . find ( a => a . network === accountState . network ) ;
if ( currentNetworkAccount ) {
infos . address = ` TREZOR Address # ${ ( currentNetworkAccount . index + 1 ) } ` ;
const device : ? TrezorDevice = findDevice ( getState ( ) . connect , currentNetworkAccount . deviceID , currentNetworkAccount . deviceState ) ;
if ( ! device ) return ;
infos . address = ` ${ device . instanceLabel } Account # ${ ( currentNetworkAccount . index + 1 ) } ` ;
} else {
// TODO: load coins from config
warnings . address = ` Looks like it's TREZOR address in Account # ${ ( savedAccounts [ 0 ] . index + 1 ) } of ${ savedAccounts [ 0 ] . network . toUpperCase ( ) } network ` ;
const device : ? TrezorDevice = findDevice ( getState ( ) . connect , savedAccounts [ 0 ] . deviceID , savedAccounts [ 0 ] . deviceState ) ;
if ( ! device ) return ;
warnings . address = ` Looks like it's ${ device . instanceLabel } Account # ${ ( savedAccounts [ 0 ] . index + 1 ) } address of ${ savedAccounts [ 0 ] . network . toUpperCase ( ) } network ` ;
}
}
}