feat: add @ mention indicator on unread badge and bump version to v0.9.76

This commit is contained in:
haorwen
2026-04-09 00:07:29 +08:00
parent dd531f6be5
commit 0a6aae8ef7
2 changed files with 22 additions and 9 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "vocechat-web",
"version": "0.9.75",
"version": "0.9.76",
"homepage": "https://voce.chat",
"dependencies": {
"@metamask/onboarding": "^1.0.1",
+21 -8
View File
@@ -105,12 +105,13 @@ const Session: FC<IProps> = ({
if (!data) return null;
const previewMsg = messageData[mid] || {};
const { name, icon, is_public } = data;
const { unreads = 0 } = getUnreadCount({
const { unreads = 0, mentions = [] } = getUnreadCount({
mids,
readIndex,
messageData,
loginUid,
});
const hasMention = mentions.length > 0;
const isVoicing =
type == "channel"
? voiceList.some((item) => {
@@ -181,14 +182,26 @@ const Session: FC<IProps> = ({
{renderPreviewMessage(previewMsg)}
</span>
{unreads > 0 && !isCurrentPath ? (
<strong
className={clsx(
`text-white px-1.5 py-[3px] font-bold text-[10px] leading-[10px] rounded-[10px]`,
muted ? "bg-black/10 dark:bg-gray-500" : "bg-primary-400"
<span className="flex items-center gap-0.5">
{hasMention && (
<strong
className={clsx(
`text-white px-1 py-[3px] font-bold text-[10px] leading-[10px] rounded-[10px]`,
muted ? "bg-black/10 dark:bg-gray-500" : "bg-primary-400"
)}
>
@
</strong>
)}
>
{unreads > 99 ? "99+" : unreads}
</strong>
<strong
className={clsx(
`text-white px-1.5 py-[3px] font-bold text-[10px] leading-[10px] rounded-[10px]`,
muted ? "bg-black/10 dark:bg-gray-500" : "bg-primary-400"
)}
>
{unreads > 99 ? "99+" : unreads}
</strong>
</span>
) : (
muted && <IconMute className="w-3 h-3 fill-black/10 dark:fill-gray-500" />
)}