Skip to content

Commit

Permalink
Fix one can change his name to empty bug. fix #129
Browse files Browse the repository at this point in the history
  • Loading branch information
petertheprocess committed May 7, 2024
1 parent 8a14da0 commit a5e69bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/views/Lobby.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ const Lobby = () => {
value={username}
onChange={(e) => {
const inputValue = e.target.value; // 获取输入值
if (inputValue.length <= MAX_USERNAME_LENGTH) { // 检查输入值的长度
if (inputValue.length <= MAX_USERNAME_LENGTH && inputValue.length > 0) { // 检查输入值的长度
setUsername(inputValue); // 如果长度小于或等于20,更新状态
}
}}
Expand Down

0 comments on commit a5e69bc

Please sign in to comment.