Bug Fixes

This commit is contained in:
yuvraj0028
2024-01-04 20:31:35 +05:30
parent 7a876d2d84
commit af27eee6de

View File

@@ -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);
};