diff --git a/apps/browser-extension-wallet/src/components/MainMenu/DropdownMenuOverlay/components/WalletAccounts.tsx b/apps/browser-extension-wallet/src/components/MainMenu/DropdownMenuOverlay/components/WalletAccounts.tsx index 6a0be466d..3dee55025 100644 --- a/apps/browser-extension-wallet/src/components/MainMenu/DropdownMenuOverlay/components/WalletAccounts.tsx +++ b/apps/browser-extension-wallet/src/components/MainMenu/DropdownMenuOverlay/components/WalletAccounts.tsx @@ -122,7 +122,7 @@ export const WalletAccounts = ({ isPopup, onBack }: { isPopup: boolean; onBack: clearSecrets(); closeDropdownAndShowAccountActivated(accountName); }, - [wallet.walletId, activateWallet, accountsData, closeDropdownAndShowAccountActivated, analytics] + [wallet.walletId, activateWallet, accountsData, closeDropdownAndShowAccountActivated, analytics, clearSecrets] ); const editAccount = useCallback( diff --git a/apps/browser-extension-wallet/src/components/MigrationContainer/MigrationContainer.tsx b/apps/browser-extension-wallet/src/components/MigrationContainer/MigrationContainer.tsx index 605c845a8..bbc5692da 100644 --- a/apps/browser-extension-wallet/src/components/MigrationContainer/MigrationContainer.tsx +++ b/apps/browser-extension-wallet/src/components/MigrationContainer/MigrationContainer.tsx @@ -48,7 +48,7 @@ export const MigrationContainer = ({ children, appMode }: MigrationContainerProp } setPassword(target); }, - [isValidPassword] + [isValidPassword, setPassword] ); const lockAndMigrate = useCallback(async () => { diff --git a/apps/browser-extension-wallet/src/features/dapp/components/SignData.tsx b/apps/browser-extension-wallet/src/features/dapp/components/SignData.tsx index 547d43470..7814b3787 100644 --- a/apps/browser-extension-wallet/src/features/dapp/components/SignData.tsx +++ b/apps/browser-extension-wallet/src/features/dapp/components/SignData.tsx @@ -43,7 +43,7 @@ export const SignData = (): React.ReactElement => { clearSecrets(); setIsLoading(false); } - }, [password, redirectToSignFailure, redirectToSignSuccess, request]); + }, [password, redirectToSignFailure, redirectToSignSuccess, request, clearSecrets]); const confirmIsDisabled = useMemo(() => { if (request.walletType !== WalletType.InMemory) return false; diff --git a/apps/browser-extension-wallet/src/features/dapp/components/SignTransaction.tsx b/apps/browser-extension-wallet/src/features/dapp/components/SignTransaction.tsx index 9bdfeed20..571503c5a 100644 --- a/apps/browser-extension-wallet/src/features/dapp/components/SignTransaction.tsx +++ b/apps/browser-extension-wallet/src/features/dapp/components/SignTransaction.tsx @@ -53,7 +53,7 @@ export const SignTransaction = (): React.ReactElement => { passphrase.fill(0); setIsLoading(false); } - }, [password, analytics, redirectToSignFailure, redirectToSignSuccess, request]); + }, [password, analytics, redirectToSignFailure, redirectToSignSuccess, request, clearSecrets]); const confirmIsDisabled = useMemo(() => { if (request.walletType !== WalletType.InMemory) return false; diff --git a/apps/browser-extension-wallet/src/features/dapp/components/collateral/CreateCollateral.tsx b/apps/browser-extension-wallet/src/features/dapp/components/collateral/CreateCollateral.tsx index eea928d3f..17c0909e3 100644 --- a/apps/browser-extension-wallet/src/features/dapp/components/collateral/CreateCollateral.tsx +++ b/apps/browser-extension-wallet/src/features/dapp/components/collateral/CreateCollateral.tsx @@ -93,7 +93,7 @@ export const CreateCollateral = ({ clearSecrets(); } setIsSubmitting(false); - }, [collateralTx, collateralInfo.amount, inMemoryWallet, password, confirm]); + }, [collateralTx, collateralInfo.amount, inMemoryWallet, password, confirm, clearSecrets]); const confirmButtonLabel = useMemo(() => { if (isInMemoryWallet) { diff --git a/apps/browser-extension-wallet/src/features/unlock-wallet/components/UnlockWalletContainer.tsx b/apps/browser-extension-wallet/src/features/unlock-wallet/components/UnlockWalletContainer.tsx index c12fe7a26..38a333c5e 100644 --- a/apps/browser-extension-wallet/src/features/unlock-wallet/components/UnlockWalletContainer.tsx +++ b/apps/browser-extension-wallet/src/features/unlock-wallet/components/UnlockWalletContainer.tsx @@ -32,7 +32,7 @@ export const UnlockWalletContainer = ({ validateMnemonic }: UnlockWalletContaine } setPassword(target); }, - [isValidPassword] + [isValidPassword, setPassword] ); useEffect(() => { diff --git a/packages/nami/.storybook/preview.tsx b/packages/nami/.storybook/preview.tsx index 3328f1653..952177108 100644 --- a/packages/nami/.storybook/preview.tsx +++ b/packages/nami/.storybook/preview.tsx @@ -7,7 +7,10 @@ import { ChakraProvider, extendTheme } from '@chakra-ui/react'; import { theme } from '../src/ui/theme'; import { Scrollbars } from 'react-custom-scrollbars-2'; import { OutsideHandlesProvider } from '../src/features/outside-handles-provider'; -import { CommonOutsideHandlesProvider } from '../src/features/common-outside-handles-provider'; +import { + CommonOutsideHandlesProvider, + NetworkConnectionStates, +} from '../src/features/common-outside-handles-provider'; import { WalletType } from '@cardano-sdk/web-extension'; const noop = (async () => {}) as any; @@ -64,6 +67,10 @@ export const decorators = [ clearSecrets: noop, password: { input: noop, value: 'pw' }, setPassword: noop, + passwordConfirmation: { input: noop, value: 'pw' }, + repeatedPassword: { input: noop, value: '' }, + setPasswordConfirmation: noop, + setRepeatedConfirmation: noop, }} delegationTxFee="200" delegationStoreDelegationTxBuilder={noop} @@ -106,6 +113,8 @@ export const decorators = [ sendEventToPostHog={noop} handleResolver={noop} withSignTxConfirmation={noop} + useNetworkError={noop} + networkConnection={NetworkConnectionStates.CONNNECTED} >