@bcc-code/vue-bcc-chat-ui 7.1.39 → 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 +26 -40
- 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
|
|
@@ -4835,7 +4831,13 @@ function cc({ environment: e }) {
|
|
|
4835
4831
|
return n();
|
|
4836
4832
|
}
|
|
4837
4833
|
async function ft() {
|
|
4838
|
-
let e = await H.
|
|
4834
|
+
let e = await H.getLoggedinUser();
|
|
4835
|
+
if (!e) try {
|
|
4836
|
+
e = await H.getLoggedInUser();
|
|
4837
|
+
} catch (e) {
|
|
4838
|
+
if (e && typeof e == "object" && "code" in e && e.code === "USER_NOT_LOGED_IN") return;
|
|
4839
|
+
console.error("Error fetching logged in user:", e);
|
|
4840
|
+
}
|
|
4839
4841
|
_.value = e ? hc(e) : null, h.value = !!e;
|
|
4840
4842
|
}
|
|
4841
4843
|
function pt() {
|
|
@@ -4971,22 +4973,13 @@ function cc({ environment: e }) {
|
|
|
4971
4973
|
return m.value ? [] : pc(await H.getMessageReceipts(String(e.id)));
|
|
4972
4974
|
}
|
|
4973
4975
|
function Ct() {
|
|
4974
|
-
|
|
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();
|
|
4975
4977
|
}
|
|
4976
4978
|
async function wt(e) {
|
|
4977
|
-
if (
|
|
4978
|
-
options: e,
|
|
4979
|
-
realtimeSuspended: V,
|
|
4980
|
-
offlineMode: m.value,
|
|
4981
|
-
activeConversationId: T.value
|
|
4982
|
-
}), ie) return console.log("Refresh already in progress, returning existing promise."), ie;
|
|
4979
|
+
if (ie) return ie;
|
|
4983
4980
|
let t = e?.includeThread ?? !0;
|
|
4984
4981
|
ie = (async () => {
|
|
4985
|
-
|
|
4986
|
-
activeConversationId: T.value,
|
|
4987
|
-
includeThread: t,
|
|
4988
|
-
activeThreadParentMessageId: E.value?.id
|
|
4989
|
-
}), 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);
|
|
4990
4983
|
})();
|
|
4991
4984
|
try {
|
|
4992
4985
|
await ie;
|
|
@@ -9828,7 +9821,6 @@ var uf = { class: "w-full" }, df = {
|
|
|
9828
9821
|
await ie();
|
|
9829
9822
|
});
|
|
9830
9823
|
async function ae() {
|
|
9831
|
-
console.log("Ensuring conversation is loaded for chatUid:", f.chatUid);
|
|
9832
9824
|
let e = T.value;
|
|
9833
9825
|
if (!e) {
|
|
9834
9826
|
console.warn("No active client available.");
|
|
@@ -9836,27 +9828,21 @@ var uf = { class: "w-full" }, df = {
|
|
|
9836
9828
|
}
|
|
9837
9829
|
x.value = !0, v.value = !1, C.value = !1;
|
|
9838
9830
|
try {
|
|
9839
|
-
e.conversations.value.length === 0 &&
|
|
9831
|
+
e.conversations.value.length === 0 && await e.fetchConversations();
|
|
9840
9832
|
let t = e.conversations.value.find((e) => e.targetId === f.chatUid || e.id === f.chatUid) ?? null;
|
|
9841
|
-
if (!t) {
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
v.value = !1, C.value = !0, p("chatMembersFetched", []);
|
|
9848
|
-
return;
|
|
9849
|
-
}
|
|
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;
|
|
9850
9839
|
}
|
|
9851
9840
|
}
|
|
9852
9841
|
if (!t) {
|
|
9853
|
-
|
|
9842
|
+
v.value = !0, C.value = !1, p("chatMembersFetched", []);
|
|
9854
9843
|
return;
|
|
9855
9844
|
}
|
|
9856
|
-
|
|
9857
|
-
conversation: t,
|
|
9858
|
-
activeConversationId: e.activeConversationId.value
|
|
9859
|
-
}), 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);
|
|
9860
9846
|
} finally {
|
|
9861
9847
|
x.value = !1;
|
|
9862
9848
|
}
|