Skip to content

Commit

Permalink
fix: [lw-11759] handle invalid pass while signing dapp tx (#1487)
Browse files Browse the repository at this point in the history
  • Loading branch information
vetalcore authored and mchappell committed Oct 29, 2024
1 parent 17ee33e commit 17191f3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/nami/src/ui/app/pages/dapp-connector/signTx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { Wallet } from '@lace/cardano';
import MiddleEllipsis from 'react-middle-ellipsis';
import { firstValueFrom } from 'rxjs';

import { ERROR } from '../../../../config/config';
import { Events } from '../../../../features/analytics/events';
import { useCaptureEvent } from '../../../../features/analytics/hooks';
import { useCommonOutsideHandles } from '../../../../features/common-outside-handles-provider';
Expand Down Expand Up @@ -546,7 +547,14 @@ export const SignTx = ({
try {
await request?.sign(password ?? '');
} catch (error) {
if (
error instanceof Wallet.KeyManagement.errors.AuthenticationError
) {
setIsLoading(l => ({ ...l, error: ERROR.wrongPassword }));
throw ERROR.wrongPassword;
}
setIsLoading(l => ({ ...l, error: `Failed to sign. ${error}` }));
throw `Failed to sign. ${error}`;
}
}}
onConfirm={async status => {
Expand Down

0 comments on commit 17191f3

Please sign in to comment.