From 3be1e91cc093488f4f7fe2c6c584e079e336ce69 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Mon, 8 May 2023 11:29:28 +0200 Subject: [PATCH] Capture e-mail changes only if there are non-whitespace characters --- .storybook/main.ts | 5 ++++- src/components/InstallationWizard/index.tsx | 10 +++++++--- src/containers/InstallationWizard/index.tsx | 2 +- src/containers/RecentActivity/index.tsx | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 071b0d006..a8e8bbfb0 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -9,7 +9,10 @@ const config: StorybookConfig = { ], framework: { name: "@storybook/react-webpack5", - options: {} + options: { + fastRefresh: true, + strictMode: true + } }, core: { disableTelemetry: true diff --git a/src/components/InstallationWizard/index.tsx b/src/components/InstallationWizard/index.tsx index 0f75cabeb..423de7bbe 100644 --- a/src/components/InstallationWizard/index.tsx +++ b/src/components/InstallationWizard/index.tsx @@ -247,9 +247,13 @@ export const InstallationWizard = () => { }; const handleEmailInputChange = (e: ChangeEvent) => { - setIsEmailValid(undefined); - setIsEmailValidating(true); - setEmail(e.target.value.trim()); + const value = e.target.value.trim(); + + if (email !== value) { + setIsEmailValid(undefined); + setIsEmailValidating(true); + setEmail(value); + } }; const handleFinishButtonClick = () => { diff --git a/src/containers/InstallationWizard/index.tsx b/src/containers/InstallationWizard/index.tsx index 55be57547..4aa7c64fb 100644 --- a/src/containers/InstallationWizard/index.tsx +++ b/src/containers/InstallationWizard/index.tsx @@ -4,8 +4,8 @@ import { initializeDigmaMessageListener, sendMessage } from "../../api"; -import { App } from "../../components/common/App"; import { InstallationWizard } from "../../components/InstallationWizard"; +import { App } from "../../components/common/App"; import { dispatcher } from "../../dispatcher"; import { GlobalStyle } from "./styles"; diff --git a/src/containers/RecentActivity/index.tsx b/src/containers/RecentActivity/index.tsx index 7b0ea62a7..bdd998cc3 100644 --- a/src/containers/RecentActivity/index.tsx +++ b/src/containers/RecentActivity/index.tsx @@ -4,8 +4,8 @@ import { initializeDigmaMessageListener, sendMessage } from "../../api"; -import { App } from "../../components/common/App"; import { RecentActivity } from "../../components/RecentActivity"; +import { App } from "../../components/common/App"; import { dispatcher } from "../../dispatcher"; import { GlobalStyle } from "./styles";