@connectycube/chat-widget 0.46.0 → 0.46.2

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/index.es.js CHANGED
@@ -672,7 +672,10 @@ const aV = "@connectycube/chat-widget:session", XA = "@connectycube/chat-widget:
672
672
  }, ae = () => {
673
673
  const q = Nq();
674
674
  return te(q);
675
- }, oA = (q) => te(q || Nq())?.userStatus ?? "available", mA = async (q, A = !1) => {
675
+ }, oA = (q) => {
676
+ const { userStatus: A } = te(q || Nq()) || {}, V = typeof A == "string" ? A.toLowerCase() : "available";
677
+ return V === "away" ? "away" : V === "busy" ? "busy" : V === "unknown" ? "unknown" : "available";
678
+ }, mA = async (q, A = !1) => {
676
679
  const V = ae(), e = Object.assign({}, V, q), o = JSON.stringify(e), r = Tq();
677
680
  let n = Nq();
678
681
  return n && A ? n = { ...n, custom_data: o } : n = (await oq.users.update({ custom_data: o })).user, r && fA({ ...r, user: n }, rA()), n;
@@ -1236,7 +1239,7 @@ const yg = () => {
1236
1239
  const d = () => {
1237
1240
  r(w), l.current = w;
1238
1241
  };
1239
- q ? d() : c.current.subscribeToUserLastActivity = d;
1242
+ q ? o(w, !0).finally(() => d()) : c.current.subscribeToUserLastActivity = d;
1240
1243
  }, M = () => {
1241
1244
  const w = l.current;
1242
1245
  if (!w)