@ethora/chat-component 25.6.7 → 25.6.8
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/main.js
CHANGED
|
@@ -2397,18 +2397,17 @@ function t0(n, e, i) {
|
|
|
2397
2397
|
}
|
|
2398
2398
|
const ys = async (n, e, i = 2e3) => {
|
|
2399
2399
|
let t;
|
|
2400
|
-
const r = () => n.off("stanza", t)
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
r(), l(c);
|
|
2400
|
+
const r = () => n.off("stanza", t), s = new Promise(async (a, A) => {
|
|
2401
|
+
let o = !1;
|
|
2402
|
+
const f = (c, h) => {
|
|
2403
|
+
o || (o = !0, setTimeout(() => {
|
|
2404
|
+
r(), c(h);
|
|
2406
2405
|
}, i));
|
|
2407
2406
|
};
|
|
2408
|
-
t = (
|
|
2409
|
-
|
|
2407
|
+
t = (c) => {
|
|
2408
|
+
c.is("presence") && c.attrs.id === "presenceInRoom" && c.attrs.from?.startsWith(e) && f(a, c);
|
|
2410
2409
|
}, n.on("stanza", t);
|
|
2411
|
-
const
|
|
2410
|
+
const d = Y.xml(
|
|
2412
2411
|
"presence",
|
|
2413
2412
|
{
|
|
2414
2413
|
from: n.jid?.toString(),
|
|
@@ -2418,18 +2417,12 @@ const ys = async (n, e, i = 2e3) => {
|
|
|
2418
2417
|
Y.xml("x", { xmlns: "http://jabber.org/protocol/muc" })
|
|
2419
2418
|
);
|
|
2420
2419
|
try {
|
|
2421
|
-
await n.send(
|
|
2422
|
-
} catch (
|
|
2423
|
-
return r(),
|
|
2424
|
-
}
|
|
2425
|
-
const d = _n(2e3, () => {
|
|
2426
|
-
A || o(a, new Error("Presence in room timeout"));
|
|
2427
|
-
});
|
|
2428
|
-
try {
|
|
2429
|
-
await d;
|
|
2430
|
-
} catch {
|
|
2431
|
-
A || o(a, new Error("Presence in room timeout"));
|
|
2420
|
+
await n.send(d);
|
|
2421
|
+
} catch (c) {
|
|
2422
|
+
return r(), A(c);
|
|
2432
2423
|
}
|
|
2424
|
+
const l = _n(2e3, r);
|
|
2425
|
+
return Promise.race([s, l]);
|
|
2433
2426
|
});
|
|
2434
2427
|
};
|
|
2435
2428
|
function r0(n, e) {
|
|
@@ -4897,7 +4890,7 @@ const Cv = {
|
|
|
4897
4890
|
},
|
|
4898
4891
|
popMessageFromHeap: (n) => {
|
|
4899
4892
|
const e = new Map(n.messageHeap ?? []), i = e.keys().next().value;
|
|
4900
|
-
|
|
4893
|
+
i && (e.delete(i), n.messageHeap = Array.from(e.entries()));
|
|
4901
4894
|
},
|
|
4902
4895
|
clearHeap: (n) => {
|
|
4903
4896
|
n.messageHeap = [];
|