mirror of
https://github.com/Qortal/chrome-extension.git
synced 2025-02-11 17:55:49 +00:00
added icon for ui group chat msgs
This commit is contained in:
parent
7086aa69a6
commit
dbfdb75cee
@ -501,6 +501,8 @@ const handleNotification = async (groups) => {
|
|||||||
|
|
||||||
let isFocused;
|
let isFocused;
|
||||||
const data = groups.filter((group) => group?.sender !== address && !mutedGroups.includes(group.groupId) && !isUpdateMsg(group?.data));
|
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 {
|
try {
|
||||||
if(isDisableNotifications) return
|
if(isDisableNotifications) return
|
||||||
if (!data || data?.length === 0) return;
|
if (!data || data?.length === 0) return;
|
||||||
@ -619,7 +621,7 @@ const handleNotification = async (groups) => {
|
|||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
if (!data || data?.length === 0) return;
|
if (!data || data?.length === 0) return;
|
||||||
setChatHeads(data);
|
setChatHeads(dataWithUpdates);
|
||||||
// chrome.runtime.sendMessage(
|
// chrome.runtime.sendMessage(
|
||||||
// {
|
// {
|
||||||
// action: "setChatHeads",
|
// action: "setChatHeads",
|
||||||
|
@ -133,7 +133,8 @@ export const ChatGroup = ({selectedGroup, secretKey, setSecretKey, getSecretKey,
|
|||||||
id: item.signature,
|
id: item.signature,
|
||||||
text: item?.decryptedData?.message || "",
|
text: item?.decryptedData?.message || "",
|
||||||
repliedTo: item?.repliedTo || item?.decryptedData?.repliedTo,
|
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])
|
setMessages((prev)=> [...prev, ...formatted])
|
||||||
@ -210,6 +211,7 @@ export const ChatGroup = ({selectedGroup, secretKey, setSecretKey, getSecretKey,
|
|||||||
id: item.signature,
|
id: item.signature,
|
||||||
text: item?.decryptedData?.message || "",
|
text: item?.decryptedData?.message || "",
|
||||||
repliedTo: item?.repliedTo || item?.decryptedData?.repliedTo,
|
repliedTo: item?.repliedTo || item?.decryptedData?.repliedTo,
|
||||||
|
isNotEncrypted: !!item?.messageText,
|
||||||
unread: false
|
unread: false
|
||||||
}
|
}
|
||||||
} )
|
} )
|
||||||
|
@ -15,7 +15,7 @@ import { WrapperUserAction } from "../WrapperUserAction";
|
|||||||
import ReplyIcon from "@mui/icons-material/Reply";
|
import ReplyIcon from "@mui/icons-material/Reply";
|
||||||
import { Spacer } from "../../common/Spacer";
|
import { Spacer } from "../../common/Spacer";
|
||||||
import { ReactionPicker } from "../ReactionPicker";
|
import { ReactionPicker } from "../ReactionPicker";
|
||||||
|
import KeyOffIcon from '@mui/icons-material/KeyOff';
|
||||||
export const MessageItem = ({
|
export const MessageItem = ({
|
||||||
message,
|
message,
|
||||||
onSeen,
|
onSeen,
|
||||||
@ -113,6 +113,7 @@ export const MessageItem = ({
|
|||||||
>
|
>
|
||||||
{message?.senderName || message?.sender}
|
{message?.senderName || message?.sender}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
</WrapperUserAction>
|
</WrapperUserAction>
|
||||||
<Box sx={{
|
<Box sx={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
@ -243,7 +244,18 @@ export const MessageItem = ({
|
|||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</Box>
|
</Box>
|
||||||
|
<Box sx={{
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
gap: '15px'
|
||||||
|
}}>
|
||||||
|
{message?.isNotEncrypted && (
|
||||||
|
<KeyOffIcon sx={{
|
||||||
|
color: 'white',
|
||||||
|
marginLeft: '10px'
|
||||||
|
}} />
|
||||||
|
)}
|
||||||
|
|
||||||
{isUpdating ? (
|
{isUpdating ? (
|
||||||
<Typography
|
<Typography
|
||||||
sx={{
|
sx={{
|
||||||
@ -275,6 +287,7 @@ export const MessageItem = ({
|
|||||||
{formatTimestamp(message.timestamp)}
|
{formatTimestamp(message.timestamp)}
|
||||||
</Typography>
|
</Typography>
|
||||||
)}
|
)}
|
||||||
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user