Skip to content

Commit

Permalink
fix: review issues
Browse files Browse the repository at this point in the history
  • Loading branch information
schmanu committed Oct 20, 2023
1 parent 2dfe922 commit ad3e34f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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)
}
}

Expand Down
1 change: 1 addition & 0 deletions src/components/settings/ExportMPCAccount/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@

.modalError {
width: 100%;
margin: 0;
}
2 changes: 1 addition & 1 deletion src/hooks/wallets/mpc/useMPCWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.')

Check warning on line 150 in src/hooks/wallets/mpc/useMPCWallet.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

Check warning on line 151 in src/hooks/wallets/mpc/useMPCWallet.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

Expand Down

0 comments on commit ad3e34f

Please sign in to comment.