1
0
mirror of https://github.com/trezor/trezor-wallet synced 2025-01-12 17:10:56 +00:00
This commit is contained in:
slowbackspace 2019-04-12 16:18:15 +02:00
parent c2544c2461
commit 42b7d6b3f0
2 changed files with 7 additions and 4 deletions

View File

@ -21,12 +21,14 @@ export type ImportAccountAction =
error: ?string,
};
const findIndex = (accounts: Array<Account>, network: Network, device: TrezorDevice): number => {
return accounts.filter(
a => a.imported === true && a.network === network.shortcut && a.deviceID === (device.features|| {}).device_id
a =>
a.imported === true &&
a.network === network.shortcut &&
a.deviceID === (device.features || {}).device_id
).length;
}
};
export const importAddress = (
address: string,

View File

@ -92,7 +92,8 @@ export const getSelectedAccount = (state: State): ?Account => {
return state.accounts.find(
a =>
a.imported === isImported &&
(a.deviceState === device.state || a.imported) &&
(a.deviceState === device.state ||
(a.imported && a.deviceID === (device.features || {}).device_id)) &&
a.index === index &&
a.network === locationState.network
);