From ad3e34f238590a647598015911bdc319dbbc0d55 Mon Sep 17 00:00:00 2001 From: schmanu Date: Fri, 20 Oct 2023 12:50:15 +0200 Subject: [PATCH] fix: review issues --- .../settings/ExportMPCAccount/ExportMPCAccountModal.tsx | 3 ++- src/components/settings/ExportMPCAccount/styles.module.css | 1 + src/hooks/wallets/mpc/useMPCWallet.ts | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/settings/ExportMPCAccount/ExportMPCAccountModal.tsx b/src/components/settings/ExportMPCAccount/ExportMPCAccountModal.tsx index 58c71f6a8e..efffab0b71 100644 --- a/src/components/settings/ExportMPCAccount/ExportMPCAccountModal.tsx +++ b/src/components/settings/ExportMPCAccount/ExportMPCAccountModal.tsx @@ -9,6 +9,7 @@ import css from './styles.module.css' import ErrorCodes from '@/services/exceptions/ErrorCodes' import { logError } from '@/services/exceptions' import ErrorMessage from '@/components/tx/ErrorMessage' +import { asError } from '@/services/exceptions/utils' enum ExportFieldNames { password = 'password', @@ -42,7 +43,7 @@ const ExportMPCAccountModal = ({ onClose, open }: { onClose: () => void; open: b setValue(ExportFieldNames.pk, pk) } catch (err) { logError(ErrorCodes._305, err) - setError('Error exporting account. Your entered password might be invalid.') + setError(asError(err).message) } } diff --git a/src/components/settings/ExportMPCAccount/styles.module.css b/src/components/settings/ExportMPCAccount/styles.module.css index 951417f090..c818925ecd 100644 --- a/src/components/settings/ExportMPCAccount/styles.module.css +++ b/src/components/settings/ExportMPCAccount/styles.module.css @@ -6,4 +6,5 @@ .modalError { width: 100%; + margin: 0; } diff --git a/src/hooks/wallets/mpc/useMPCWallet.ts b/src/hooks/wallets/mpc/useMPCWallet.ts index 00267a5595..753b199a48 100644 --- a/src/hooks/wallets/mpc/useMPCWallet.ts +++ b/src/hooks/wallets/mpc/useMPCWallet.ts @@ -147,7 +147,7 @@ export const useMPCWallet = (): MPCWalletHook => { const exportedPK = await mpcCoreKit?._UNSAFE_exportTssKey() return exportedPK } catch (err) { - throw new Error('Error exporting account key. Password may be wrong') + throw new Error('Error exporting account. Make sure the password is correct.') } }