แก้ไขการแสดงสถานะ "อ่านแล้ว" (support)
This commit is contained in:
parent
e6d623074d
commit
76a1d36d04
2 changed files with 9 additions and 7 deletions
|
|
@ -66,12 +66,14 @@ function dateChat(timestamp: string) {
|
|||
<q-space />
|
||||
<div
|
||||
v-if="
|
||||
store.messageStatus?.result.some(
|
||||
(v) =>
|
||||
store.messageStatus?.result.some((v) => {
|
||||
return (
|
||||
new Date(v.lastAccessDate).getTime() >=
|
||||
new Date(item.createdAt).getTime() &&
|
||||
v.fromUserId !== store.userId &&
|
||||
index + 1 === store.message?.result.message.length
|
||||
)
|
||||
);
|
||||
})
|
||||
"
|
||||
class="q-mr-xl"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -88,14 +88,14 @@ export const useSupportStore = defineStore("supportServiceStore", () => {
|
|||
// console.log(message.value?.result.message);
|
||||
});
|
||||
|
||||
socket.on("read", (r: SupportMessageStatus) => {
|
||||
socket.on("read", (r) => {
|
||||
if (messageStatus.value) {
|
||||
messageStatus.value.result = messageStatus.value.result.map((v) => {
|
||||
if (v.fromUserId !== r.fromUserId) return r;
|
||||
if (v.fromUserId === r.fromUserId) return r;
|
||||
return v;
|
||||
});
|
||||
// console.log("event(read):", messageStatus.value);
|
||||
}
|
||||
// console.log("event(read):", messageStatus.value);
|
||||
});
|
||||
|
||||
function scrollToEnd(position: Number = 1) {
|
||||
|
|
@ -227,7 +227,7 @@ export const useSupportStore = defineStore("supportServiceStore", () => {
|
|||
messageStatus,
|
||||
userStatus,
|
||||
currentIssue,
|
||||
currentIssueDate,
|
||||
currentIssueDate,
|
||||
currentTitle,
|
||||
fetchIssue,
|
||||
fetchIssueCategory,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue