diff --git a/frontend/src/pages/Chat/index.js b/frontend/src/pages/Chat/index.js index 355b8dec..50f71538 100644 --- a/frontend/src/pages/Chat/index.js +++ b/frontend/src/pages/Chat/index.js @@ -70,6 +70,7 @@ export function ChatModal({ type, handleClose, handleLoadNewChat, + user, }) { const [users, setUsers] = useState([]); const [title, setTitle] = useState(""); @@ -77,7 +78,7 @@ export function ChatModal({ useEffect(() => { setTitle(""); setUsers([]); - if (type === "edit") { + if (type === "edit" && chat?.users) { const userList = chat.users.map((u) => ({ id: u.user.id, name: u.user.name, @@ -140,6 +141,7 @@ export function ChatModal({ setUsers(users)} initialUsers={users} + excludeId={user.id} /> @@ -460,6 +462,7 @@ function Chat(props) { history.push(`/chats/${data.uuid}`); }} handleClose={() => setShowDialog(false)} + user={user} /> {isWidthUp("md", props.width) ? renderGrid() : renderTab()}