From e7ba8da8e4d3f6ceaec641f47a73223935d788c1 Mon Sep 17 00:00:00 2001 From: heisenberg <110591045+heisenberg-2077@users.noreply.github.com> Date: Mon, 11 Nov 2024 14:41:04 +0800 Subject: [PATCH] fix: keystone exception when saving advanced settings (#2615) --- 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) {