Skip to content

Commit 01e9ff9

Browse files
authored
fix: [lw-11759] handle invalid pass while signing dapp tx (#1487)
1 parent 301b9be commit 01e9ff9

File tree

1 file changed

+8
-0
lines changed
  • packages/nami/src/ui/app/pages/dapp-connector

1 file changed

+8
-0
lines changed

packages/nami/src/ui/app/pages/dapp-connector/signTx.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { Wallet } from '@lace/cardano';
2525
import MiddleEllipsis from 'react-middle-ellipsis';
2626
import { firstValueFrom } from 'rxjs';
2727

28+
import { ERROR } from '../../../../config/config';
2829
import { Events } from '../../../../features/analytics/events';
2930
import { useCaptureEvent } from '../../../../features/analytics/hooks';
3031
import { useCommonOutsideHandles } from '../../../../features/common-outside-handles-provider';
@@ -546,7 +547,14 @@ export const SignTx = ({
546547
try {
547548
await request?.sign(password ?? '');
548549
} catch (error) {
550+
if (
551+
error instanceof Wallet.KeyManagement.errors.AuthenticationError
552+
) {
553+
setIsLoading(l => ({ ...l, error: ERROR.wrongPassword }));
554+
throw ERROR.wrongPassword;
555+
}
549556
setIsLoading(l => ({ ...l, error: `Failed to sign. ${error}` }));
557+
throw `Failed to sign. ${error}`;
550558
}
551559
}}
552560
onConfirm={async status => {

0 commit comments

Comments
 (0)