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