@bcc-code/vue-bcc-chat-ui 7.1.15 → 7.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/vue-bcc-chat-ui.js +12 -11
- package/dist/vue-bcc-chat-ui.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -322,6 +322,7 @@ export declare interface ChatConversationItem {
|
|
|
322
322
|
tags: string[];
|
|
323
323
|
memberCount?: number;
|
|
324
324
|
source?: Conversation | null;
|
|
325
|
+
lastMessage?: ChatMessageItem | null;
|
|
325
326
|
}
|
|
326
327
|
|
|
327
328
|
export declare type ChatDeliveryState = "sent" | "queued" | "sending" | "failed";
|
package/dist/vue-bcc-chat-ui.js
CHANGED
|
@@ -4707,6 +4707,7 @@ function cc({ environment: e }) {
|
|
|
4707
4707
|
try {
|
|
4708
4708
|
await tt({ reset: !0 }), v.value = v.value.map((t) => t.id === e.id ? {
|
|
4709
4709
|
...t,
|
|
4710
|
+
lastMessage: y.value.at(-1) ?? null,
|
|
4710
4711
|
unreadCount: 0
|
|
4711
4712
|
} : t), V?.setConversations(v.value);
|
|
4712
4713
|
} catch (n) {
|
|
@@ -6044,18 +6045,18 @@ async function Wl(e) {
|
|
|
6044
6045
|
}
|
|
6045
6046
|
}
|
|
6046
6047
|
async function Gl(e, t) {
|
|
6047
|
-
let n = e.source?.getLastMessage?.();
|
|
6048
|
-
if (!n) return;
|
|
6049
|
-
let
|
|
6050
|
-
return
|
|
6048
|
+
let n = e.lastMessage, r = n ? void 0 : e.source?.getLastMessage?.();
|
|
6049
|
+
if (!(r || n)) return;
|
|
6050
|
+
let i = n?.senderId ?? r?.getSender?.()?.getUid?.() ?? "", a = String(n?.id ?? r?.getId?.() ?? ""), o = !!(t && i && t === i && a);
|
|
6051
|
+
return o && a && Il.value[a] === void 0 && !Ll.has(a) && await Wl(a), {
|
|
6051
6052
|
text: e.subtitle,
|
|
6052
|
-
type: n
|
|
6053
|
-
senderUid:
|
|
6054
|
-
senderName: n
|
|
6055
|
-
sentAt: /* @__PURE__ */ new Date((
|
|
6056
|
-
sentByCurrentUser:
|
|
6057
|
-
readAt:
|
|
6058
|
-
messageReceipts:
|
|
6053
|
+
type: n?.type ?? r?.getType?.() ?? "text",
|
|
6054
|
+
senderUid: i,
|
|
6055
|
+
senderName: n?.senderName ?? r?.getSender?.()?.getName?.() ?? "System",
|
|
6056
|
+
sentAt: n?.sentAt ?? /* @__PURE__ */ new Date((r?.getSentAt?.() ?? 0) * 1e3),
|
|
6057
|
+
sentByCurrentUser: o,
|
|
6058
|
+
readAt: r?.getReadAt?.() ? /* @__PURE__ */ new Date(r.getReadAt() * 1e3) : void 0,
|
|
6059
|
+
messageReceipts: o ? Il.value[a] : void 0
|
|
6059
6060
|
};
|
|
6060
6061
|
}
|
|
6061
6062
|
var Kl = n(() => Q.value?.connected.value ?? !1), ql = n(() => kl.value && !Kl.value), Jl = n(() => Q.value?.loggedIn.value ?? !1), Yl = {
|