diff --git a/apps/codac-quasseln/src/pages/main-chat/[chatId].tsx b/apps/codac-quasseln/src/pages/main-chat/[chatId].tsx index 9e0ba5c5..95aaf114 100644 --- a/apps/codac-quasseln/src/pages/main-chat/[chatId].tsx +++ b/apps/codac-quasseln/src/pages/main-chat/[chatId].tsx @@ -36,7 +36,7 @@ const getChatHistoryById = gql` id attributes { pinned - messages { + messages(pagination: { page: 1, pageSize: 100 }) { data { id attributes { @@ -145,6 +145,7 @@ const updatePinnedConversation = gql` `; const SingleChat = (props: Props) => { + const [testVariable, setTestVariable] = useState(false); const { user } = useAuth(); console.log("user :>> ", user); const userId = user?.id; @@ -219,6 +220,7 @@ const SingleChat = (props: Props) => { setMessageText(""); } refetch(); + setTestVariable(!testVariable); }; // const [deleteMessageMutation] = useMutation(deleteChatMessage); @@ -286,15 +288,6 @@ const SingleChat = (props: Props) => { // +++++++++++++++++++++++ MODALS ++++++++++++++++++++++ - const [deleteModal, setDeleteModal] = useState(false); - const [optionsModal, setOptionsModal] = useState(false); - const toogleDeleteModal = () => { - setDeleteModal(!deleteModal); - }; - const toogleOptionsModal = () => { - setOptionsModal(!optionsModal); - }; - return (

{
{conversations && - conversations.chatroom?.data?.attributes.conversations?.data?.map((conversation: any) => { - // console.log("conversation :>> ", conversation); - if (conversation.attributes.pinned === true) { - return ( -
{ - setActive(conversation.id); - }} - > - {/* HIER COME THE PINN ICON; PLEASE CHANGE IT FOR THE

*/} - <> - {user?.role?.name === "Mentor" ? ( -

updatePinned(e, conversation)} - style={{ cursor: "pointer" }} - > - X -

- ) : ( - "" - )} - -

{ + // console.log("conversation :>> ", conversation); + if (conversation.attributes.pinned === true) { + return ( +
{ + setActive(conversation.id); }} > - {conversation.attributes?.title} -

-
- ); + {/* HIER COME THE PINN ICON; PLEASE CHANGE IT FOR THE

*/} + <> + {user?.role?.name === "Mentor" ? ( +

updatePinned(e, conversation)} + style={{ cursor: "pointer" }} + > + X +

+ ) : ( + "" + )} + +

+ {conversation.attributes?.title} +

+
+ ); + } } - })} + )}


@@ -382,49 +377,51 @@ const SingleChat = (props: Props) => {
{conversations && - conversations.chatroom?.data?.attributes.conversations?.data?.map((conversation: any) => { - console.log("conversation :>> ", conversation); - if (conversation.attributes.pinned === false) { - return ( -
{ - setActive(conversation.id); - }} - > - {/* HIER COME THE PINN ICON; PLEASE CHANGE IT FOR THE

*/} - <> - {user?.role?.name === "Mentor" ? ( -

updatePinned(e, conversation)} - style={{ cursor: "pointer" }} - > - X -

- ) : ( - "" - )} - - -

{ + console.log("conversation :>> ", conversation); + if (conversation.attributes.pinned === false) { + return ( +
{ + setActive(conversation.id); }} > - {conversation.attributes?.title} -

-
- ); + {/* HIER COME THE PINN ICON; PLEASE CHANGE IT FOR THE

*/} + <> + {user?.role?.name === "Mentor" ? ( +

updatePinned(e, conversation)} + style={{ cursor: "pointer" }} + > + X +

+ ) : ( + "" + )} + + +

+ {conversation.attributes?.title} +

+
+ ); + } } - })} + )} @@ -497,3 +494,5 @@ const SingleChat = (props: Props) => { }; export default SingleChat; + +