Скрываем счетчик непрочитанных при синхронизации
This commit is contained in:
@@ -18,6 +18,8 @@ import { useDialogInfo } from "@/app/providers/DialogListProvider/useDialogInfo"
|
|||||||
import { useDialogContextMenu } from "@/app/hooks/useDialogContextMenu";
|
import { useDialogContextMenu } from "@/app/hooks/useDialogContextMenu";
|
||||||
import { useDialogPin } from "@/app/providers/DialogStateProvider.tsx/useDialogPin";
|
import { useDialogPin } from "@/app/providers/DialogStateProvider.tsx/useDialogPin";
|
||||||
import { useDialogMute } from "@/app/providers/DialogStateProvider.tsx/useDialogMute";
|
import { useDialogMute } from "@/app/providers/DialogStateProvider.tsx/useDialogMute";
|
||||||
|
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;
|
||||||
@@ -51,6 +53,7 @@ export function Dialog(props : DialogProps) {
|
|||||||
|
|
||||||
const isInCurrentDialog = props.dialog_id == сurrentDialogPublicKeyView;
|
const isInCurrentDialog = props.dialog_id == сurrentDialogPublicKeyView;
|
||||||
const currentDialogColor = computedTheme == 'dark' ? '#2a6292' :'#438fd1';
|
const currentDialogColor = computedTheme == 'dark' ? '#2a6292' :'#438fd1';
|
||||||
|
const [protocolState] = useProtocolState();
|
||||||
|
|
||||||
usePacket(0x0B, (packet : PacketTyping) => {
|
usePacket(0x0B, (packet : PacketTyping) => {
|
||||||
if(packet.getFromPublicKey() == opponent && packet.getToPublicKey() == publicKey && !fromMe){
|
if(packet.getFromPublicKey() == opponent && packet.getToPublicKey() == publicKey && !fromMe){
|
||||||
@@ -153,7 +156,7 @@ export function Dialog(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 && <Badge
|
{unreaded > 0 && !lastMessageFromMe && protocolState != ProtocolState.SYNCHRONIZATION && <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>}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
export const SERVERS = [
|
export const SERVERS = [
|
||||||
//'wss://cdn.rosetta-im.com',
|
//'wss://cdn.rosetta-im.com',
|
||||||
//'ws://10.211.55.2:3000',
|
//'ws://10.211.55.2:3000',
|
||||||
'ws://127.0.0.1:3000',
|
//'ws://127.0.0.1:3000',
|
||||||
//'wss://wss.rosetta.im'
|
'wss://wss.rosetta.im'
|
||||||
];
|
];
|
||||||
|
|
||||||
export function selectServer(): string {
|
export function selectServer(): string {
|
||||||
|
|||||||
Reference in New Issue
Block a user