@bcc-code/vue-bcc-chat-ui 7.1.33 → 7.1.35

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.
@@ -4193,7 +4193,11 @@ function cc({ environment: e }) {
4193
4193
  }
4194
4194
  let I = n(() => v.value.find((e) => e.id === T.value) ?? null), te = `bcc-ui-connection-${crypto.randomUUID()}`, L = `bcc-ui-message-${crypto.randomUUID()}`, R = !1, z = !1, ne = null, B = null, re = null, ie = null, ae = 0, oe = 0, se = !1, V = !1, U = null, ce = /* @__PURE__ */ new Map(), le = /* @__PURE__ */ new Set(), ue = null, de = null, fe = 0;
4195
4195
  async function pe() {
4196
- await lc(e), !t.value && (ve(), ft(), t.value = !0, await ut(), _.value && (dt(_.value.uid), ge(), Te(), !m.value && !V && Ce()));
4196
+ if (await lc(e), t.value) {
4197
+ await ut();
4198
+ return;
4199
+ }
4200
+ ve(), ft(), t.value = !0, await ut(), _.value && (dt(_.value.uid), ge(), Te(), !m.value && !V && Ce());
4197
4201
  }
4198
4202
  async function me(e) {
4199
4203
  g.value = null, r.value = !0;
@@ -4248,6 +4252,12 @@ function cc({ environment: e }) {
4248
4252
  return Date.now() < ae;
4249
4253
  }
4250
4254
  function Se(e = !1) {
4255
+ if (!h.value) {
4256
+ ut().then(() => {
4257
+ h.value && Se(e);
4258
+ });
4259
+ return;
4260
+ }
4251
4261
  if (ne !== null || B || m.value || !h.value || V) return;
4252
4262
  let t = e ? 0 : Math.min(3e4, 1e3 * 2 ** Math.min(oe, 4));
4253
4263
  ne = setTimeout(() => {
@@ -4269,7 +4279,7 @@ function cc({ environment: e }) {
4269
4279
  let t = H.connect;
4270
4280
  typeof t == "function" && (await t.call(H), p.value = !0), oe = 0, se && await we();
4271
4281
  } catch (e) {
4272
- p.value = !1, oe += 1, Lt(e) || (g.value = Z(e, "Unable to reconnect to chat.")), Se();
4282
+ p.value = !1, oe += 1, Lt(e) || (g.value = Z(e, "Unable to reconnect to chat.")), setTimeout(Se, 1e3);
4273
4283
  } finally {
4274
4284
  B = null;
4275
4285
  }