added icon for ui group chat msgs

This commit is contained in:
PhilReact 2024-09-27 22:09:14 +03:00
parent 7086aa69a6
commit dbfdb75cee
3 changed files with 21 additions and 4 deletions

View File

@ -501,6 +501,8 @@ const handleNotification = async (groups) => {
let isFocused;
const data = groups.filter((group) => group?.sender !== address && !mutedGroups.includes(group.groupId) && !isUpdateMsg(group?.data));
const dataWithUpdates = groups.filter((group) => group?.sender !== address && !mutedGroups.includes(group.groupId));
try {
if(isDisableNotifications) return
if (!data || data?.length === 0) return;
@ -619,7 +621,7 @@ const handleNotification = async (groups) => {
}
} finally {
if (!data || data?.length === 0) return;
setChatHeads(data);
setChatHeads(dataWithUpdates);
// chrome.runtime.sendMessage(
// {
// action: "setChatHeads",

View File

@ -133,7 +133,8 @@ export const ChatGroup = ({selectedGroup, secretKey, setSecretKey, getSecretKey,
id: item.signature,
text: item?.decryptedData?.message || "",
repliedTo: item?.repliedTo || item?.decryptedData?.repliedTo,
unread: item?.sender === myAddress ? false : !!item?.chatReference ? false : true
unread: item?.sender === myAddress ? false : !!item?.chatReference ? false : true,
isNotEncrypted: !!item?.messageText
}
} )
setMessages((prev)=> [...prev, ...formatted])
@ -210,6 +211,7 @@ export const ChatGroup = ({selectedGroup, secretKey, setSecretKey, getSecretKey,
id: item.signature,
text: item?.decryptedData?.message || "",
repliedTo: item?.repliedTo || item?.decryptedData?.repliedTo,
isNotEncrypted: !!item?.messageText,
unread: false
}
} )

View File

@ -15,7 +15,7 @@ import { WrapperUserAction } from "../WrapperUserAction";
import ReplyIcon from "@mui/icons-material/Reply";
import { Spacer } from "../../common/Spacer";
import { ReactionPicker } from "../ReactionPicker";
import KeyOffIcon from '@mui/icons-material/KeyOff';
export const MessageItem = ({
message,
onSeen,
@ -113,6 +113,7 @@ export const MessageItem = ({
>
{message?.senderName || message?.sender}
</Typography>
</WrapperUserAction>
<Box sx={{
display: 'flex',
@ -243,7 +244,18 @@ export const MessageItem = ({
)
})}
</Box>
<Box sx={{
display: 'flex',
alignItems: 'center',
gap: '15px'
}}>
{message?.isNotEncrypted && (
<KeyOffIcon sx={{
color: 'white',
marginLeft: '10px'
}} />
)}
{isUpdating ? (
<Typography
sx={{
@ -275,6 +287,7 @@ export const MessageItem = ({
{formatTimestamp(message.timestamp)}
</Typography>
)}
</Box>
</Box>
</Box>