фикс
This commit is contained in:
parent
205c58d906
commit
ff4605064d
@ -91,7 +91,6 @@
|
|||||||
<span v-if="item.data.isEdited" class="message-edited">(изменено)</span>
|
<span v-if="item.data.isEdited" class="message-edited">(изменено)</span>
|
||||||
<!-- Индикатор статуса теперь внутри пузырька для отправленных сообщений -->
|
<!-- Индикатор статуса теперь внутри пузырька для отправленных сообщений -->
|
||||||
<span v-if="item.data.sender?._id === currentUser?._id" class="message-status-inside">
|
<span v-if="item.data.sender?._id === currentUser?._id" class="message-status-inside">
|
||||||
<!-- Debugging: {{ getMessageStatusIcon(item.data) }} -->
|
|
||||||
<i :class="getMessageStatusIcon(item.data)"></i>
|
<i :class="getMessageStatusIcon(item.data)"></i>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@ -683,7 +682,7 @@ const formatMessageTimestamp = (timestamp) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getMessageStatusIcon = (message) => {
|
const getMessageStatusIcon = (message) => {
|
||||||
let iconClass = 'bi bi-question-circle'; // Default to a question mark for debugging
|
let iconClass = 'bi bi-question-circle';
|
||||||
|
|
||||||
if (message.status) {
|
if (message.status) {
|
||||||
switch (message.status) {
|
switch (message.status) {
|
||||||
@ -697,24 +696,19 @@ const getMessageStatusIcon = (message) => {
|
|||||||
iconClass = 'bi bi-check2-all';
|
iconClass = 'bi bi-check2-all';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
iconClass = 'bi bi-patch-check'; // A different check for unknown status
|
iconClass = 'bi bi-patch-check';
|
||||||
console.warn('[ChatView] Unknown message status:', message.status, 'for message:', message._id);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (message.isSending) { // Fallback for older logic
|
} else if (message.isSending) {
|
||||||
iconClass = 'bi bi-clock';
|
iconClass = 'bi bi-clock';
|
||||||
console.log(`[ChatView] Message ID: ${message._id} using isSending, Status: ${message.status}, Icon: ${iconClass}`);
|
|
||||||
} else {
|
} else {
|
||||||
// Fallback if no status and not isSending
|
|
||||||
const otherParticipant = getOtherParticipant();
|
const otherParticipant = getOtherParticipant();
|
||||||
if (otherParticipant && message.readBy && message.readBy.includes(otherParticipant._id)) {
|
if (otherParticipant && message.readBy && message.readBy.includes(otherParticipant._id)) {
|
||||||
iconClass = 'bi bi-check2-all';
|
iconClass = 'bi bi-check2-all';
|
||||||
} else {
|
} else {
|
||||||
iconClass = 'bi bi-check'; // Single check if no status and not read by other
|
iconClass = 'bi bi-check';
|
||||||
}
|
}
|
||||||
console.warn(`[ChatView] Message ID: ${message._id} has no status field and not isSending. Fallback icon: ${iconClass}. readBy:`, message.readBy);
|
|
||||||
}
|
}
|
||||||
console.log(`[ChatView] FINAL - Message ID: ${message._id}, Original Status: ${message.status}, Icon: ${iconClass}`);
|
|
||||||
return iconClass;
|
return iconClass;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user