Исправление индикатора непрочитанных в диалогах группы при синхронизаци
This commit is contained in:
@@ -17,6 +17,8 @@ import { useDialogContextMenu } from "@/app/hooks/useDialogContextMenu";
|
|||||||
import { useDialogMute } from "@/app/providers/DialogStateProvider.tsx/useDialogMute";
|
import { useDialogMute } from "@/app/providers/DialogStateProvider.tsx/useDialogMute";
|
||||||
import { useDialogPin } from "@/app/providers/DialogStateProvider.tsx/useDialogPin";
|
import { useDialogPin } from "@/app/providers/DialogStateProvider.tsx/useDialogPin";
|
||||||
import { useMentions } from "@/app/providers/DialogStateProvider.tsx/useMentions";
|
import { useMentions } from "@/app/providers/DialogStateProvider.tsx/useMentions";
|
||||||
|
import { useProtocolState } from "@/app/providers/ProtocolProvider/useProtocolState";
|
||||||
|
import { ProtocolState } from "@/app/providers/ProtocolProvider/ProtocolProvider";
|
||||||
|
|
||||||
export interface DialogProps extends DialogRow {
|
export interface DialogProps extends DialogRow {
|
||||||
onClickDialog: (dialog: string) => void;
|
onClickDialog: (dialog: string) => void;
|
||||||
@@ -54,6 +56,7 @@ export function GroupDialog(props : DialogProps) {
|
|||||||
const currentDialogColor = computedTheme == 'dark' ? '#2a6292' :'#438fd1';
|
const currentDialogColor = computedTheme == 'dark' ? '#2a6292' :'#438fd1';
|
||||||
const {openContextMenu} = useDialogContextMenu();
|
const {openContextMenu} = useDialogContextMenu();
|
||||||
const {isMentioned} = useMentions();
|
const {isMentioned} = useMentions();
|
||||||
|
const [protocolState] = useProtocolState();
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -156,7 +159,7 @@ export function GroupDialog(props : DialogProps) {
|
|||||||
{!loading && (lastMessage.delivered == DeliveredMessageState.ERROR || (!isMessageDeliveredByTime(lastMessage.timestamp, lastMessage.attachments.length) && lastMessage.delivered != DeliveredMessageState.DELIVERED)) && (
|
{!loading && (lastMessage.delivered == DeliveredMessageState.ERROR || (!isMessageDeliveredByTime(lastMessage.timestamp, lastMessage.attachments.length) && lastMessage.delivered != DeliveredMessageState.DELIVERED)) && (
|
||||||
<IconAlertCircle stroke={3} size={15} color={colors.error}></IconAlertCircle>
|
<IconAlertCircle stroke={3} size={15} color={colors.error}></IconAlertCircle>
|
||||||
)}
|
)}
|
||||||
{unreaded > 0 && !lastMessageFromMe && !isMentioned(props.dialog_id) && <Badge
|
{unreaded > 0 && !lastMessageFromMe && protocolState != ProtocolState.SYNCHRONIZATION && !isMentioned(props.dialog_id) && <Badge
|
||||||
color={isInCurrentDialog ? 'white' : (isMuted ? colors.chevrons.active : colors.brandColor)}
|
color={isInCurrentDialog ? 'white' : (isMuted ? colors.chevrons.active : colors.brandColor)}
|
||||||
c={isInCurrentDialog ? colors.brandColor : 'white'}
|
c={isInCurrentDialog ? colors.brandColor : 'white'}
|
||||||
size={'sm'} circle={unreaded < 10}>{unreaded > 99 ? '99+' : unreaded}</Badge>}
|
size={'sm'} circle={unreaded < 10}>{unreaded > 99 ? '99+' : unreaded}</Badge>}
|
||||||
|
|||||||
Reference in New Issue
Block a user