mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-24 01:08:27 +00:00
fixed getSelecedDevice in WalletService
This commit is contained in:
parent
053b12d3ff
commit
751a96ccc1
@ -24,7 +24,16 @@ const getSelectedDevice = (state: State): ?TrezorDevice => {
|
|||||||
if (!locationState.device) return null;
|
if (!locationState.device) return null;
|
||||||
|
|
||||||
const instance: ?number = locationState.deviceInstance ? parseInt(locationState.deviceInstance) : undefined;
|
const instance: ?number = locationState.deviceInstance ? parseInt(locationState.deviceInstance) : undefined;
|
||||||
return state.connect.devices.find(d => d.features && d.features.device_id === locationState.device && d.instance === instance);
|
return state.connect.devices.find(d => {
|
||||||
|
if (d.unacquired && d.path === locationState.device) {
|
||||||
|
return true;
|
||||||
|
} else if (d.features && d.features.bootloader_mode && d.path === locationState.device) {
|
||||||
|
return true;
|
||||||
|
} else if (d.features && d.features.device_id === locationState.device && d.instance === instance) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user