diff --git a/src/components/Chat/MessageDisplay.tsx b/src/components/Chat/MessageDisplay.tsx index b52a5be..885f986 100644 --- a/src/components/Chat/MessageDisplay.tsx +++ b/src/components/Chat/MessageDisplay.tsx @@ -3,12 +3,13 @@ import DOMPurify from 'dompurify'; import './styles.css'; // Ensure this CSS file is imported export const MessageDisplay = ({ htmlContent }) => { + const linkify = (text) => { // Regular expression to find URLs starting with https://, http://, or www. const urlPattern = /(\bhttps?:\/\/[^\s<]+|\bwww\.[^\s<]+)/g; // Replace plain text URLs with anchor tags - return text.replace(urlPattern, (url) => { + return text?.replace(urlPattern, (url) => { const href = url.startsWith('http') ? url : `https://${url}`; return `${DOMPurify.sanitize(url)}`; }); diff --git a/src/components/Group/Group.tsx b/src/components/Group/Group.tsx index 51973e2..200e478 100644 --- a/src/components/Group/Group.tsx +++ b/src/components/Group/Group.tsx @@ -762,6 +762,7 @@ export const Group = ({ const getMembers = async (groupId) => { try { const res = await getGroupMembers(groupId); + if(groupId !== selectedGroupRef.current?.groupId) return setMembers(res); } catch (error) {} }; @@ -773,7 +774,6 @@ export const Group = ({ }, [selectedGroup?.groupId]); const shouldReEncrypt = useMemo(() => { - if (triedToFetchSecretKey && !secretKeyPublishDate) return true; if ( !secretKeyPublishDate ||