Bug Fixes
This commit is contained in:
@@ -4,8 +4,8 @@ const users = [];
|
||||
|
||||
const addUser = ({ id, username, room }) => {
|
||||
// Clean the data
|
||||
username = username.trim().toLowerCase();
|
||||
room = room.trim().toLowerCase();
|
||||
username = username.trim();
|
||||
room = room.trim();
|
||||
|
||||
// validate the data
|
||||
if (!username || !room) {
|
||||
@@ -45,7 +45,7 @@ const getUser = (id) => {
|
||||
};
|
||||
|
||||
const getUsersInRoom = (room) => {
|
||||
room = room.trim().toLowerCase();
|
||||
room = room.trim();
|
||||
return users.filter((user) => user.room === room);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user