diff --git a/src/views/mod-tools/views/room-chatlog/ModToolsChatlogView.tsx b/src/views/mod-tools/views/room-chatlog/ModToolsChatlogView.tsx index b1799000..2c23264f 100644 --- a/src/views/mod-tools/views/room-chatlog/ModToolsChatlogView.tsx +++ b/src/views/mod-tools/views/room-chatlog/ModToolsChatlogView.tsx @@ -20,10 +20,10 @@ export const ModToolsChatlogView: FC = props => { const parser = event.getParser(); - if(!parser) return; + if(!parser || parser.data.roomId !== roomId) return; setRoomChatlog(parser.data); - }, [setRoomChatlog]); + }, [roomId, setRoomChatlog]); CreateMessageHook(ModtoolRoomChatlogEvent, onModtoolRoomChatlogEvent); diff --git a/src/views/mod-tools/views/room/ModToolsRoomView.tsx b/src/views/mod-tools/views/room/ModToolsRoomView.tsx index a6bd2a7b..31d8459f 100644 --- a/src/views/mod-tools/views/room/ModToolsRoomView.tsx +++ b/src/views/mod-tools/views/room/ModToolsRoomView.tsx @@ -32,13 +32,15 @@ export const ModToolsRoomView: FC = props => { const parser = event.getParser(); + if(!parser || parser.id !== roomId) return; + setLoadedRoomId(parser.id); setName(parser.name); setOwnerId(parser.ownerId); setOwnerName(parser.ownerName); setOwnerInRoom(parser.ownerInRoom); setUsersInRoom(parser.playerAmount); - }, [ setLoadedRoomId, setName, setOwnerId, setOwnerName, setOwnerInRoom, setUsersInRoom ]); + }, [ setLoadedRoomId, setName, setOwnerId, setOwnerName, setOwnerInRoom, setUsersInRoom, roomId ]); CreateMessageHook(ModtoolRoomInfoEvent, onModtoolRoomInfoEvent); diff --git a/src/views/mod-tools/views/user-chatlog/ModToolsUserChatlogView.tsx b/src/views/mod-tools/views/user-chatlog/ModToolsUserChatlogView.tsx index 23b1590d..d2ca9bd0 100644 --- a/src/views/mod-tools/views/user-chatlog/ModToolsUserChatlogView.tsx +++ b/src/views/mod-tools/views/user-chatlog/ModToolsUserChatlogView.tsx @@ -20,11 +20,11 @@ export const ModToolsUserChatlogView: FC = props = { const parser = event.getParser(); - if(!parser) return; + if(!parser || parser.userId !== userId) return; setUsername(parser.username); setUserChatlog(parser.roomVisits); - }, [setUsername, setUserChatlog]); + }, [setUsername, setUserChatlog, userId]); CreateMessageHook(ModtoolUserChatlogEvent, onModtoolUserChatlogEvent); diff --git a/src/views/mod-tools/views/user/ModToolsUserView.tsx b/src/views/mod-tools/views/user/ModToolsUserView.tsx index 03c109fa..373bd2df 100644 --- a/src/views/mod-tools/views/user/ModToolsUserView.tsx +++ b/src/views/mod-tools/views/user/ModToolsUserView.tsx @@ -21,11 +21,10 @@ export const ModToolsUserView: FC = props => { const parser = event.getParser(); - if(!parser) return; + if(!parser || parser.data.userId !== userId) return; - console.log(parser); setUserInfo(parser.data); - }, [setUserInfo]); + }, [setUserInfo, userId]); CreateMessageHook(ModtoolUserInfoEvent, onModtoolUserInfoEvent);