Skip to content

Commit

Permalink
fix: keystone exception when saving advanced settings (RabbyHub#2615)
Browse files Browse the repository at this point in the history
  • Loading branch information
heisenberg-2077 authored and christianholman committed Nov 20, 2024
1 parent ffa4a1a commit e7ba8da
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/ui/views/HDManager/QRCodeManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,25 @@ export const QRCodeManager: React.FC<Props> = ({ brand }) => {
try {
setLoading(true);

if (type !== setting.type) {
if (setting.type && type !== setting.type) {
/**
* This code is written to be consistent with the behavior of importing wallets via QR Code.
*/
await removeAddressAndForgetDevice(false);
}

await wallet.requestKeyring(
KEYSTONE_TYPE,
'getAddressesViaUSB',
keyringId,
type
);
try {
await wallet.requestKeyring(
KEYSTONE_TYPE,
'getAddressesViaUSB',
keyringId,
type
);
} catch (e) {
// ignore
console.error(e);
}

await getCurrentAccounts();
setLoading(false);
} catch (error) {
Expand Down

0 comments on commit e7ba8da

Please sign in to comment.