Skip to content

Commit c3dd6a8

Browse files
committed
Fix bug
Bug: username must be edited in order to submit the form
1 parent e84cf61 commit c3dd6a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Frontend/src/components/user/EditProfile.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function EditProfile() {
5151
const usernameRegex = /^[a-zA-Z0-9._]{3,20}$/;
5252
const isValidUsername = usernameRegex.test(username)
5353

54-
if(!isValidUsername) {
54+
if(!isValidUsername && username !== "") {
5555
console.log("username is not valid:", username)
5656
setUsernameError(true)
5757
setErrorMessage("Username can only contain letters, numbers, dots (.), and underscores (_), and must be between 3 and 20 characters long.")

0 commit comments

Comments
 (0)