From 66509804c9bb0d756d5789dd2cf72b4b717c3827 Mon Sep 17 00:00:00 2001 From: John Oshalusi Date: Mon, 9 Dec 2024 18:48:38 +0100 Subject: [PATCH 1/2] fix: collateral password issue --- .../components/Collateral/send/CollateralFooterSend.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/browser-extension-wallet/src/views/browser-view/features/settings/components/Collateral/send/CollateralFooterSend.tsx b/apps/browser-extension-wallet/src/views/browser-view/features/settings/components/Collateral/send/CollateralFooterSend.tsx index 99d6fdd6e..653a81c04 100644 --- a/apps/browser-extension-wallet/src/views/browser-view/features/settings/components/Collateral/send/CollateralFooterSend.tsx +++ b/apps/browser-extension-wallet/src/views/browser-view/features/settings/components/Collateral/send/CollateralFooterSend.tsx @@ -44,8 +44,6 @@ export const CollateralFooterSend = ({ const submitTx = async () => withSignTxConfirmation(submitCollateralTx, secretsUtil.password.value); const handleClick = async () => { - onClaim(); - if (!hasEnoughAda) { return onClose(); } @@ -53,6 +51,7 @@ export const CollateralFooterSend = ({ if (popupView && !isInMemory) return await backgroundServices?.handleOpenBrowser({ section: BrowserViewSections.COLLATERAL_SETTINGS }); await submitTx(); + onClaim(); toast.notify({ text: t('browserView.settings.wallet.collateral.toast.add') }); if (isInMemory) onClose(); } catch { From f3a977c0df026f08f327edafdec1c446b918ed8b Mon Sep 17 00:00:00 2001 From: John Oshalusi Date: Mon, 9 Dec 2024 21:15:47 +0100 Subject: [PATCH 2/2] fix: resolve build issue on main --- .../generate-key-flow/EnterPassword/EnterPassword.tsx | 5 +++++ .../components/WalletSetup/WalletSetupPasswordStep.tsx | 9 ++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/core/src/shared-wallets/add-shared-wallet/generate-key-flow/EnterPassword/EnterPassword.tsx b/packages/core/src/shared-wallets/add-shared-wallet/generate-key-flow/EnterPassword/EnterPassword.tsx index 1514a71b0..eb6e792cd 100644 --- a/packages/core/src/shared-wallets/add-shared-wallet/generate-key-flow/EnterPassword/EnterPassword.tsx +++ b/packages/core/src/shared-wallets/add-shared-wallet/generate-key-flow/EnterPassword/EnterPassword.tsx @@ -44,6 +44,11 @@ export const EnterPassword: VFC = ({ const icon = mapOfWalletTypeIconProperties[kind]; const next = () => { + if (!password.value) { + console.error('Password is undefined'); + return; + } + onGenerateKeys(password.value); clearSecrets(); }; diff --git a/packages/core/src/ui/components/WalletSetup/WalletSetupPasswordStep.tsx b/packages/core/src/ui/components/WalletSetup/WalletSetupPasswordStep.tsx index 82ad23264..1168f2181 100644 --- a/packages/core/src/ui/components/WalletSetup/WalletSetupPasswordStep.tsx +++ b/packages/core/src/ui/components/WalletSetup/WalletSetupPasswordStep.tsx @@ -60,10 +60,9 @@ export const WalletSetupPasswordStep = ({ const passwordConfirmationErrorMessage = passHasBeenValidated && password !== passwordConfirmation ? translations.noMatchPassword : ''; const isNextEnabled = Boolean( - passHasBeenValidated && - !passwordConfirmationErrorMessage && - score >= minimumPassLevelRequired && - password.value.length > 0 + passHasBeenValidated && !passwordConfirmationErrorMessage && score >= minimumPassLevelRequired && password?.value + ? password.value.length > 0 + : false ); const complexityBarList: BarStates = useMemo(() => getComplexityBarStateList(score), [score]); @@ -79,7 +78,7 @@ export const WalletSetupPasswordStep = ({ description={translations.description} onBack={onBack} onNext={() => { - onNext({ password: password.value }); + password.value ? onNext({ password: password.value }) : console.error('Password is undefined'); }} isNextEnabled={isNextEnabled} currentTimelineStep={WalletTimelineSteps.WALLET_SETUP}