1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-24 09:18:09 +00:00

fixed getSelecedDevice in WalletService

This commit is contained in:
Szymon Lesisz 2018-05-22 20:40:04 +02:00
parent 053b12d3ff
commit 751a96ccc1

View File

@ -24,7 +24,16 @@ const getSelectedDevice = (state: State): ?TrezorDevice => {
if (!locationState.device) return null;
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;
});
}
/**