corp-chat-library-antd-react-socket 1.0.7 → 1.0.9

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.
Files changed (2) hide show
  1. package/dist/index.js +3 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -8594,11 +8594,7 @@ const Pt = /* @__PURE__ */ ai(fh), zs = Qr(void 0), gh = ({ children: e }) => {
8594
8594
  console.log("connect false");
8595
8595
  return;
8596
8596
  }
8597
- if (t.current?.connected) {
8598
- console.log("connect false");
8599
- return;
8600
- }
8601
- console.log("connect true");
8597
+ t.current?.connected && t.current.disconnect(), console.log("connect true");
8602
8598
  const q = Tc(`${c}:${h}`, { transports: ["websocket", "polling"], withCredentials: !0 });
8603
8599
  t.current = q, q.on("connect", () => {
8604
8600
  console.log("CHAT WEBSOCKET CONNECTED"), n(!0), o("connected");
@@ -8633,7 +8629,7 @@ const Pt = /* @__PURE__ */ ai(fh), zs = Qr(void 0), gh = ({ children: e }) => {
8633
8629
  ze();
8634
8630
  }, 0);
8635
8631
  return () => {
8636
- clearTimeout(q), console.log("Cleaning up socket connection");
8632
+ clearTimeout(q), console.log("Cleaning up socket connection"), t.current?.disconnect();
8637
8633
  };
8638
8634
  } else
8639
8635
  console.log("Connection conditions not met:", {
@@ -9655,6 +9651,7 @@ const Th = ({ open: e, onOk: t, onCancel: r, positionCorner: n }) => {
9655
9651
  fe(() => {
9656
9652
  n || console.log("disconnected");
9657
9653
  }, [n]), fe(() => {
9654
+ i(null);
9658
9655
  }, [i, a]), fe(() => {
9659
9656
  e && e?.user && l(e.user.id);
9660
9657
  }, [e]);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "corp-chat-library-antd-react-socket",
3
3
  "description": "React chat component with Ant Design and Socket.io support",
4
- "version": "1.0.7",
4
+ "version": "1.0.9",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",