Skip to content

Commit ca02f7c

Browse files
committed
Rename state as also used for non signed in email
1 parent c793eb1 commit ca02f7c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dotcom-rendering/src/components/SecureSignup.importable.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ export const SecureSignup = ({
274274
}: Props) => {
275275
const recaptchaRef = useRef<ReactGoogleRecaptcha>(null);
276276
const [captchaSiteKey, setCaptchaSiteKey] = useState<string>();
277-
const [signedInUserEmail, setSignedInUserEmail] = useState<string>();
277+
const [userEmail, setUserEmail] = useState<string>();
278278
const [hideEmailInput, setHideEmailInput] = useState<boolean>();
279279
const [isWaitingForResponse, setIsWaitingForResponse] =
280280
useState<boolean>(false);
@@ -299,7 +299,7 @@ export const SecureSignup = ({
299299
useEffect(() => {
300300
setCaptchaSiteKey(window.guardian.config.page.googleRecaptchaSiteKey);
301301
void resolveEmailIfSignedIn().then((email) => {
302-
setSignedInUserEmail(email);
302+
setUserEmail(email);
303303
setHideEmailInput(isString(email));
304304
});
305305
}, []);
@@ -422,8 +422,8 @@ export const SecureSignup = ({
422422
name="email"
423423
label="Enter your email address"
424424
type="email"
425-
value={signedInUserEmail ?? ''}
426-
onChange={(e) => setSignedInUserEmail(e.target.value)}
425+
value={userEmail ?? ''}
426+
onChange={(e) => setUserEmail(e.target.value)}
427427
/>
428428
{isSignedIn === false && (
429429
<CheckboxGroup

0 commit comments

Comments
 (0)