mirror of
https://github.com/trezor/trezor-wallet
synced 2025-06-13 19:48:47 +00:00
fix: dont try to pair imported accounts with used passphrase
This commit is contained in:
parent
642adf45af
commit
e95ebe54b6
@ -34,11 +34,7 @@ export const importAddress = (
|
|||||||
|
|
||||||
let payload;
|
let payload;
|
||||||
const index = getState().accounts.filter(
|
const index = getState().accounts.filter(
|
||||||
a =>
|
a => a.imported === true && a.network === network.shortcut
|
||||||
a.imported === true &&
|
|
||||||
a.network === network.shortcut &&
|
|
||||||
device &&
|
|
||||||
a.deviceState === device.state
|
|
||||||
).length;
|
).length;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -48,7 +48,12 @@ export const findAccount = (
|
|||||||
deviceState: string,
|
deviceState: string,
|
||||||
network: string
|
network: string
|
||||||
): ?Account =>
|
): ?Account =>
|
||||||
state.find(a => a.deviceState === deviceState && a.index === index && a.network === network);
|
state.find(
|
||||||
|
a =>
|
||||||
|
(a.deviceState === deviceState || a.imported) &&
|
||||||
|
a.index === index &&
|
||||||
|
a.network === network
|
||||||
|
);
|
||||||
|
|
||||||
export const findDeviceAccounts = (
|
export const findDeviceAccounts = (
|
||||||
state: State,
|
state: State,
|
||||||
@ -56,9 +61,11 @@ export const findDeviceAccounts = (
|
|||||||
network: string
|
network: string
|
||||||
): Array<Account> => {
|
): Array<Account> => {
|
||||||
if (network) {
|
if (network) {
|
||||||
return state.filter(addr => addr.deviceState === device.state && addr.network === network);
|
return state.filter(
|
||||||
|
addr => (addr.deviceState === device.state || addr.imported) && addr.network === network
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return state.filter(addr => addr.deviceState === device.state);
|
return state.filter(addr => addr.deviceState === device.state || addr.imported);
|
||||||
};
|
};
|
||||||
|
|
||||||
const createAccount = (state: State, account: Account): State => {
|
const createAccount = (state: State, account: Account): State => {
|
||||||
|
@ -92,7 +92,7 @@ export const getSelectedAccount = (state: State): ?Account => {
|
|||||||
return state.accounts.find(
|
return state.accounts.find(
|
||||||
a =>
|
a =>
|
||||||
a.imported === isImported &&
|
a.imported === isImported &&
|
||||||
a.deviceState === device.state &&
|
(a.deviceState === device.state || a.imported) &&
|
||||||
a.index === index &&
|
a.index === index &&
|
||||||
a.network === locationState.network
|
a.network === locationState.network
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user