Skip to content

Commit

Permalink
fix: keystone exception when saving advanced settings
Browse files Browse the repository at this point in the history
  • Loading branch information
heisenberg-2077 committed Nov 11, 2024
1 parent d435e8b commit 754c7b7
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 754c7b7

Please sign in to comment.