From 6570b9f7ec7114f212c562a95fdcb49698d9e3b7 Mon Sep 17 00:00:00 2001 From: Emma Mansell <73774046+7emansell@users.noreply.github.com> Date: Mon, 25 Nov 2024 12:16:34 -0500 Subject: [PATCH] Commenting --- src/components/MyAccount/NewSettings/UsernameForm.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/MyAccount/NewSettings/UsernameForm.tsx b/src/components/MyAccount/NewSettings/UsernameForm.tsx index 8db35d1eb..6857b1915 100644 --- a/src/components/MyAccount/NewSettings/UsernameForm.tsx +++ b/src/components/MyAccount/NewSettings/UsernameForm.tsx @@ -33,6 +33,11 @@ const UsernameForm = ({ patron, usernameState }: UsernameFormProps) => { const [isLoading, setIsLoading] = useState(false) const [isEditing, setIsEditing] = useState(false) const [error, setError] = useState(false) + /** + * In Sierra, the user NOT having a username is represented by the empty string: username = "". + * Within this form, the user NOT having a username is represented by: username = null, so the + * empty string is an invalid username. + */ const [input, setInput] = useState( patron.username === "" ? null : patron.username )