From 754c7b7350bcb16477f6dd82e4564a4c97da041c Mon Sep 17 00:00:00 2001 From: heisenberg Date: Mon, 11 Nov 2024 14:16:25 +0800 Subject: [PATCH] fix: keystone exception when saving advanced settings --- src/ui/views/HDManager/QRCodeManager.tsx | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/ui/views/HDManager/QRCodeManager.tsx b/src/ui/views/HDManager/QRCodeManager.tsx index ee97e0bd59b..e81351c8467 100644 --- a/src/ui/views/HDManager/QRCodeManager.tsx +++ b/src/ui/views/HDManager/QRCodeManager.tsx @@ -104,19 +104,25 @@ export const QRCodeManager: React.FC = ({ 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) {