Skip to content

Commit

Permalink
fix(suite): update useEmptyPassphrase only if passhprase is disabled …
Browse files Browse the repository at this point in the history
…on device [RELEASE ONLY]

- That condition fixing only case for devices with passhprase disabled and should not be applied for devices with passhprase_protection enabled because passhprase_protection == true doesn't mean that hidden wallet is active.
  • Loading branch information
matejkriz committed Sep 20, 2023
1 parent 7a6edf6 commit 16d4700
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/suite/src/reducers/suite/deviceReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,18 @@ const changeDevice = (
: !!device.features.passphrase_protection;
return merge(d, { ...device, ...extended, available });
}
if (!d.state && !isUnlocked(d.features) && isDeviceUnlocked) {
// if is not authorized (no state) and becomes unlocked update useEmptyPassphrase field (hidden/standard wallet)
if (
!d.state &&
!device.features.passphrase_protection &&
!isUnlocked(d.features) &&
isDeviceUnlocked
) {
// if device with passhprase disabled is not authorized (no state) and becomes unlocked update useEmptyPassphrase field (hidden/standard wallet)
return merge(d, {
...device,
...extended,
available: true,
useEmptyPassphrase: !device.features.passphrase_protection,
useEmptyPassphrase: true,
});
}
return merge(d, { ...device, ...extended });
Expand Down

0 comments on commit 16d4700

Please sign in to comment.