@bcc-code/vue-bcc-chat-ui 7.1.40 → 7.1.41
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/vue-bcc-chat-ui.js +20 -46
- package/dist/vue-bcc-chat-ui.js.map +1 -1
- package/package.json +1 -1
package/dist/vue-bcc-chat-ui.js
CHANGED
|
@@ -4340,7 +4340,7 @@ function cc({ environment: e }) {
|
|
|
4340
4340
|
}
|
|
4341
4341
|
}
|
|
4342
4342
|
async function je(e) {
|
|
4343
|
-
|
|
4343
|
+
T.value = e, E.value = null, b.value = [], de = null, C.value = !1, D.value = null, O.value = null, De(e), await it();
|
|
4344
4344
|
}
|
|
4345
4345
|
function Me(e) {
|
|
4346
4346
|
e && (O.value = null), D.value = e;
|
|
@@ -4714,14 +4714,13 @@ function cc({ environment: e }) {
|
|
|
4714
4714
|
}
|
|
4715
4715
|
async function rt(e) {
|
|
4716
4716
|
let t = I.value;
|
|
4717
|
-
if (!t || m.value) return
|
|
4717
|
+
if (!t || m.value) return y.value = [], S.value = !1, !1;
|
|
4718
4718
|
if ((e?.reset || ue?.conversationId !== t.id) && (ue = {
|
|
4719
4719
|
conversationId: t.id,
|
|
4720
4720
|
request: $e(t)
|
|
4721
4721
|
}, S.value = !0), !ue) return console.warn("No active messages request available for the conversation:", t.id), !1;
|
|
4722
|
-
console.log("Fetching messages for conversation:", t.id, "with request:", ue);
|
|
4723
4722
|
let n = await nt(ue.request);
|
|
4724
|
-
e?.reset && n.length === 0 && !m.value && !V && t.lastMessageAt && (
|
|
4723
|
+
e?.reset && n.length === 0 && !m.value && !V && t.lastMessageAt && (se = !0, await we(), ue = {
|
|
4725
4724
|
conversationId: t.id,
|
|
4726
4725
|
request: $e(t)
|
|
4727
4726
|
}, n = await nt(ue.request));
|
|
@@ -4731,22 +4730,19 @@ function cc({ environment: e }) {
|
|
|
4731
4730
|
return i && (await xt(i), await bt(i)), n.length > 0;
|
|
4732
4731
|
}
|
|
4733
4732
|
async function it() {
|
|
4734
|
-
N()
|
|
4733
|
+
N();
|
|
4735
4734
|
let e = I.value;
|
|
4736
4735
|
if (!e) {
|
|
4737
4736
|
console.warn("No active conversation to refresh messages for."), y.value = [], S.value = !1, ue = null;
|
|
4738
4737
|
return;
|
|
4739
4738
|
}
|
|
4740
4739
|
let t = De(e.id);
|
|
4741
|
-
if (a.value = !0,
|
|
4742
|
-
|
|
4743
|
-
messages: y.value
|
|
4744
|
-
}), m.value) {
|
|
4745
|
-
console.log("Offline mode enabled, using cached messages if available."), S.value = !1, ue = null, a.value = !1;
|
|
4740
|
+
if (a.value = !0, m.value) {
|
|
4741
|
+
S.value = !1, ue = null, a.value = !1;
|
|
4746
4742
|
return;
|
|
4747
4743
|
}
|
|
4748
4744
|
try {
|
|
4749
|
-
|
|
4745
|
+
await rt({ reset: !0 }), v.value = v.value.map((t) => t.id === e.id ? {
|
|
4750
4746
|
...t,
|
|
4751
4747
|
lastMessage: y.value.at(-1) ?? null,
|
|
4752
4748
|
unreadCount: 0
|
|
@@ -4977,22 +4973,13 @@ function cc({ environment: e }) {
|
|
|
4977
4973
|
return m.value ? [] : pc(await H.getMessageReceipts(String(e.id)));
|
|
4978
4974
|
}
|
|
4979
4975
|
function Ct() {
|
|
4980
|
-
|
|
4976
|
+
r.value = !1, i.value = !1, a.value = !1, o.value = !1, s.value = !1, c.value = !1, l.value = !1, u.value = !1, d.value = !1, f.value = !1, p.value = !1, ye(), oe = 0, se = !1, V = !1, h.value = !1, _.value = null, v.value = [], y.value = [], b.value = [], x.value = [], E.value = null, D.value = null, O.value = null, k.value = [], T.value = null, S.value = !1, C.value = !1, ue = null, de = null, le.clear();
|
|
4981
4977
|
}
|
|
4982
4978
|
async function wt(e) {
|
|
4983
|
-
if (
|
|
4984
|
-
options: e,
|
|
4985
|
-
realtimeSuspended: V,
|
|
4986
|
-
offlineMode: m.value,
|
|
4987
|
-
activeConversationId: T.value
|
|
4988
|
-
}), ie) return console.log("Refresh already in progress, returning existing promise."), ie;
|
|
4979
|
+
if (ie) return ie;
|
|
4989
4980
|
let t = e?.includeThread ?? !0;
|
|
4990
4981
|
ie = (async () => {
|
|
4991
|
-
|
|
4992
|
-
activeConversationId: T.value,
|
|
4993
|
-
includeThread: t,
|
|
4994
|
-
activeThreadParentMessageId: E.value?.id
|
|
4995
|
-
}), I.value && await it(), t && E.value && await ot(E.value.id);
|
|
4982
|
+
I.value && await it(), t && E.value && await ot(E.value.id);
|
|
4996
4983
|
})();
|
|
4997
4984
|
try {
|
|
4998
4985
|
await ie;
|
|
@@ -9825,13 +9812,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9825
9812
|
() => f.client ? f.client.loggedIn.value : gu.loggedIn.value,
|
|
9826
9813
|
() => T.value?.conversations.value.length ?? 0
|
|
9827
9814
|
], async ([e, t, n]) => {
|
|
9828
|
-
|
|
9829
|
-
chatUid: e,
|
|
9830
|
-
initialized: t,
|
|
9831
|
-
loggedIn: n,
|
|
9832
|
-
activeClientConversations: T.value?.conversations.value.length ?? 0,
|
|
9833
|
-
client: f.client
|
|
9834
|
-
}), !(!D.value || !e || !t || !n || !T.value) && await ae();
|
|
9815
|
+
!D.value || !e || !t || !n || !T.value || await ae();
|
|
9835
9816
|
}, { immediate: !0 }), F([
|
|
9836
9817
|
() => P.messages.value.length,
|
|
9837
9818
|
() => P.threadMessages.value.length,
|
|
@@ -9840,7 +9821,6 @@ var uf = { class: "w-full" }, df = {
|
|
|
9840
9821
|
await ie();
|
|
9841
9822
|
});
|
|
9842
9823
|
async function ae() {
|
|
9843
|
-
console.log("Ensuring conversation is loaded for chatUid:", f.chatUid);
|
|
9844
9824
|
let e = T.value;
|
|
9845
9825
|
if (!e) {
|
|
9846
9826
|
console.warn("No active client available.");
|
|
@@ -9848,27 +9828,21 @@ var uf = { class: "w-full" }, df = {
|
|
|
9848
9828
|
}
|
|
9849
9829
|
x.value = !0, v.value = !1, C.value = !1;
|
|
9850
9830
|
try {
|
|
9851
|
-
e.conversations.value.length === 0 &&
|
|
9831
|
+
e.conversations.value.length === 0 && await e.fetchConversations();
|
|
9852
9832
|
let t = e.conversations.value.find((e) => e.targetId === f.chatUid || e.id === f.chatUid) ?? null;
|
|
9853
|
-
if (!t) {
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
v.value = !1, C.value = !0, p("chatMembersFetched", []);
|
|
9860
|
-
return;
|
|
9861
|
-
}
|
|
9833
|
+
if (!t) try {
|
|
9834
|
+
t = await se(f.chatUid, e);
|
|
9835
|
+
} catch (e) {
|
|
9836
|
+
if (e && typeof e == "object" && "code" in e && e.code === "ERR_NOT_A_MEMBER") {
|
|
9837
|
+
v.value = !1, C.value = !0, p("chatMembersFetched", []);
|
|
9838
|
+
return;
|
|
9862
9839
|
}
|
|
9863
9840
|
}
|
|
9864
9841
|
if (!t) {
|
|
9865
|
-
|
|
9842
|
+
v.value = !0, C.value = !1, p("chatMembersFetched", []);
|
|
9866
9843
|
return;
|
|
9867
9844
|
}
|
|
9868
|
-
|
|
9869
|
-
conversation: t,
|
|
9870
|
-
activeConversationId: e.activeConversationId.value
|
|
9871
|
-
}), e.activeConversationId.value !== t.id && (console.log("Selecting conversation:", t.id), await e.selectConversation(t.id)), console.log("Fetching group members for conversation:", t.id), await M(t.targetId);
|
|
9845
|
+
e.activeConversationId.value !== t.id && await e.selectConversation(t.id), await M(t.targetId);
|
|
9872
9846
|
} finally {
|
|
9873
9847
|
x.value = !1;
|
|
9874
9848
|
}
|