Skip to content

Commit

Permalink
Merge pull request #30 from CS3219-AY2425S1/edit-profile-fix-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
RingoftheKing authored Oct 15, 2024
2 parents e84cf61 + c3dd6a8 commit ba763ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Frontend/src/components/user/EditProfile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function EditProfile() {
const usernameRegex = /^[a-zA-Z0-9._]{3,20}$/;
const isValidUsername = usernameRegex.test(username)

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

0 comments on commit ba763ec

Please sign in to comment.