async function ioListenerRefreshRoomUsersArray(payload) {
		const { roomName } = payload;
		// Get data from MongoDB
		let result = await fetch(process.env.REACT_APP_SERVERURL + "/chat/myrooms", {
			headers: {
				username: authUser.getUsername(),
				roomName: roomName,
				jwtAuth: authUser.getJWT(),
			},
		});
		const roomResultJSON = await result.json();
		const newUsersArray = roomResultJSON.rooms.users;
		//console.log("Room [" + roomName + "] refreshing users array: " + newUsersArray);
		// Change users of room and Update State
		const newMap = new Map(roomObjMap);
		newMap.get(roomName).users = newUsersArray;
		setRoomObjMap(newMap);
	}
/**
	 * Listener function to refresh room users array
	 * @param {Object} payload
	 */
Listener function to refresh room users array
@param {Object} payload
Listener function to refresh room users array @param { Object } payload
async function ioListenerRefreshRoomUsersArray(payload) {
		const { roomName } = payload;
		let result = await fetch(process.env.REACT_APP_SERVERURL + "/chat/myrooms", {
			headers: {
				username: authUser.getUsername(),
				roomName: roomName,
				jwtAuth: authUser.getJWT(),
			},
		});
		const roomResultJSON = await result.json();
		const newUsersArray = roomResultJSON.rooms.users;
		const newMap = new Map(roomObjMap);
		newMap.get(roomName).users = newUsersArray;
		setRoomObjMap(newMap);
	}
async function ioListenerRefreshRoomUsersArray ( payload ) { const { roomName } = payload ; let result = await fetch ( process . env . REACT_APP_SERVERURL + "/chat/myrooms" , { headers : { username : authUser . getUsername ( ) , roomName : roomName , jwtAuth : authUser . getJWT ( ) , } , } ) ; const roomResultJSON = await result . json ( ) ; const newUsersArray = roomResultJSON . rooms . users ; const newMap = new Map ( roomObjMap ) ; newMap . get ( roomName ) . users = newUsersArray ; setRoomObjMap ( newMap ) ; }
Listener function to refresh room users array
 @param {Object} payload
Listener function to refresh room users array @param { Object } payload
// Get data from MongoDB //console.log("Room [" + roomName + "] refreshing users array: " + newUsersArray); // Change users of room and Update State