Skip to content

Commit 594bbd0

Browse files
authored
fix: collateral password issue [LW-11953] (#1584)
* fix: collateral password issue * fix: resolve build issue on main
1 parent fef43f5 commit 594bbd0

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

apps/browser-extension-wallet/src/views/browser-view/features/settings/components/Collateral/send/CollateralFooterSend.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,14 @@ export const CollateralFooterSend = ({
4444
const submitTx = async () => withSignTxConfirmation(submitCollateralTx, secretsUtil.password.value);
4545

4646
const handleClick = async () => {
47-
onClaim();
48-
4947
if (!hasEnoughAda) {
5048
return onClose();
5149
}
5250
try {
5351
if (popupView && !isInMemory)
5452
return await backgroundServices?.handleOpenBrowser({ section: BrowserViewSections.COLLATERAL_SETTINGS });
5553
await submitTx();
54+
onClaim();
5655
toast.notify({ text: t('browserView.settings.wallet.collateral.toast.add') });
5756
if (isInMemory) onClose();
5857
} catch {

packages/core/src/shared-wallets/add-shared-wallet/generate-key-flow/EnterPassword/EnterPassword.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ export const EnterPassword: VFC<EnterPasswordProps> = ({
4444
const icon = mapOfWalletTypeIconProperties[kind];
4545

4646
const next = () => {
47+
if (!password.value) {
48+
console.error('Password is undefined');
49+
return;
50+
}
51+
4752
onGenerateKeys(password.value);
4853
clearSecrets();
4954
};

packages/core/src/ui/components/WalletSetup/WalletSetupPasswordStep.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,9 @@ export const WalletSetupPasswordStep = ({
6060
const passwordConfirmationErrorMessage =
6161
passHasBeenValidated && password !== passwordConfirmation ? translations.noMatchPassword : '';
6262
const isNextEnabled = Boolean(
63-
passHasBeenValidated &&
64-
!passwordConfirmationErrorMessage &&
65-
score >= minimumPassLevelRequired &&
66-
password.value.length > 0
63+
passHasBeenValidated && !passwordConfirmationErrorMessage && score >= minimumPassLevelRequired && password?.value
64+
? password.value.length > 0
65+
: false
6766
);
6867

6968
const complexityBarList: BarStates = useMemo(() => getComplexityBarStateList(score), [score]);
@@ -79,7 +78,7 @@ export const WalletSetupPasswordStep = ({
7978
description={translations.description}
8079
onBack={onBack}
8180
onNext={() => {
82-
onNext({ password: password.value });
81+
password.value ? onNext({ password: password.value }) : console.error('Password is undefined');
8382
}}
8483
isNextEnabled={isNextEnabled}
8584
currentTimelineStep={WalletTimelineSteps.WALLET_SETUP}

0 commit comments

Comments
 (0)