@bcc-code/vue-bcc-chat-ui 7.1.38 → 7.1.40
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 +38 -17
- 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
|
-
T.value = e, E.value = null, b.value = [], de = null, C.value = !1, D.value = null, O.value = null, De(e), await it();
|
|
4343
|
+
console.log("select conversation", { conversationId: e }), 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;
|
|
@@ -4835,7 +4835,13 @@ function cc({ environment: e }) {
|
|
|
4835
4835
|
return n();
|
|
4836
4836
|
}
|
|
4837
4837
|
async function ft() {
|
|
4838
|
-
let e = await H.
|
|
4838
|
+
let e = await H.getLoggedinUser();
|
|
4839
|
+
if (!e) try {
|
|
4840
|
+
e = await H.getLoggedInUser();
|
|
4841
|
+
} catch (e) {
|
|
4842
|
+
if (e && typeof e == "object" && "code" in e && e.code === "USER_NOT_LOGED_IN") return;
|
|
4843
|
+
console.error("Error fetching logged in user:", e);
|
|
4844
|
+
}
|
|
4839
4845
|
_.value = e ? hc(e) : null, h.value = !!e;
|
|
4840
4846
|
}
|
|
4841
4847
|
function pt() {
|
|
@@ -4971,7 +4977,7 @@ function cc({ environment: e }) {
|
|
|
4971
4977
|
return m.value ? [] : pc(await H.getMessageReceipts(String(e.id)));
|
|
4972
4978
|
}
|
|
4973
4979
|
function Ct() {
|
|
4974
|
-
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();
|
|
4980
|
+
console.log("Clearing chat state due to logout or connection issues."), 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
4981
|
}
|
|
4976
4982
|
async function wt(e) {
|
|
4977
4983
|
if (console.log("Request to refresh visible messages received.", {
|
|
@@ -9819,7 +9825,13 @@ var uf = { class: "w-full" }, df = {
|
|
|
9819
9825
|
() => f.client ? f.client.loggedIn.value : gu.loggedIn.value,
|
|
9820
9826
|
() => T.value?.conversations.value.length ?? 0
|
|
9821
9827
|
], async ([e, t, n]) => {
|
|
9822
|
-
|
|
9828
|
+
console.log("Watcher triggered for conversation loading.", {
|
|
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();
|
|
9823
9835
|
}, { immediate: !0 }), F([
|
|
9824
9836
|
() => P.messages.value.length,
|
|
9825
9837
|
() => P.threadMessages.value.length,
|
|
@@ -9828,13 +9840,19 @@ var uf = { class: "w-full" }, df = {
|
|
|
9828
9840
|
await ie();
|
|
9829
9841
|
});
|
|
9830
9842
|
async function ae() {
|
|
9843
|
+
console.log("Ensuring conversation is loaded for chatUid:", f.chatUid);
|
|
9831
9844
|
let e = T.value;
|
|
9832
|
-
if (e) {
|
|
9833
|
-
|
|
9834
|
-
|
|
9835
|
-
|
|
9836
|
-
|
|
9837
|
-
|
|
9845
|
+
if (!e) {
|
|
9846
|
+
console.warn("No active client available.");
|
|
9847
|
+
return;
|
|
9848
|
+
}
|
|
9849
|
+
x.value = !0, v.value = !1, C.value = !1;
|
|
9850
|
+
try {
|
|
9851
|
+
e.conversations.value.length === 0 && (console.log("No conversations found, fetching conversations from server."), await e.fetchConversations());
|
|
9852
|
+
let t = e.conversations.value.find((e) => e.targetId === f.chatUid || e.id === f.chatUid) ?? null;
|
|
9853
|
+
if (!t) {
|
|
9854
|
+
console.log("Conversation not found, attempting to resolve by group UID.");
|
|
9855
|
+
try {
|
|
9838
9856
|
t = await se(f.chatUid, e);
|
|
9839
9857
|
} catch (e) {
|
|
9840
9858
|
if (e && typeof e == "object" && "code" in e && e.code === "ERR_NOT_A_MEMBER") {
|
|
@@ -9842,14 +9860,17 @@ var uf = { class: "w-full" }, df = {
|
|
|
9842
9860
|
return;
|
|
9843
9861
|
}
|
|
9844
9862
|
}
|
|
9845
|
-
if (!t) {
|
|
9846
|
-
v.value = !0, C.value = !1, p("chatMembersFetched", []);
|
|
9847
|
-
return;
|
|
9848
|
-
}
|
|
9849
|
-
e.activeConversationId.value !== t.id && await e.selectConversation(t.id), await M(t.targetId);
|
|
9850
|
-
} finally {
|
|
9851
|
-
x.value = !1;
|
|
9852
9863
|
}
|
|
9864
|
+
if (!t) {
|
|
9865
|
+
console.log("Conversation not found after attempting to resolve by group UID."), v.value = !0, C.value = !1, p("chatMembersFetched", []);
|
|
9866
|
+
return;
|
|
9867
|
+
}
|
|
9868
|
+
console.log("Conversation found:", {
|
|
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);
|
|
9872
|
+
} finally {
|
|
9873
|
+
x.value = !1;
|
|
9853
9874
|
}
|
|
9854
9875
|
}
|
|
9855
9876
|
async function se(e, t) {
|