@sawport/react-sdk 1.0.9-alpha.0 → 1.0.9-alpha.1

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.js CHANGED
@@ -67909,7 +67909,7 @@ const immerImpl = (initializer) => (set2, get2, store) => {
67909
67909
  return initializer(store.setState, get2, store);
67910
67910
  };
67911
67911
  const immer = immerImpl;
67912
- const __vite_import_meta_env__ = { "BASE_URL": "/", "DEV": false, "MODE": "production", "PROD": true, "SSR": false };
67912
+ const __vite_import_meta_env__ = { "BASE_URL": "/", "DEV": false, "MODE": "production", "PROD": true, "SSR": false, "VITE_API_URL": "http://localhost:5000/api/v1/", "VITE_BASE_URL": "http://localhost:5000", "VITE_PROJECT_ID": "dc956202-5374-4256-985e-a492fcd26992" };
67913
67913
  const trackedConnections = /* @__PURE__ */ new Map();
67914
67914
  const getTrackedConnectionState = (name) => {
67915
67915
  const api2 = trackedConnections.get(name);
@@ -103473,17 +103473,21 @@ const ChatInput = memo(function({ company }) {
103473
103473
  );
103474
103474
  useEffect(() => {
103475
103475
  var _a2;
103476
- if (!scheduleReminderCanceled) {
103477
- if ((!agentConnected || !!(agentDetails == null ? void 0 : agentDetails.id)) && ((_a2 = company == null ? void 0 : company.options) == null ? void 0 : _a2.schedulePopUpTime)) {
103478
- const intervalId = setInterval(
103479
- () => setPopupVisible(true),
103480
- company.options.schedulePopUpTime
103481
- );
103482
- return () => clearInterval(intervalId);
103476
+ let popupTimeoutId = null;
103477
+ if (!scheduleReminderCanceled && ((_a2 = company == null ? void 0 : company.options) == null ? void 0 : _a2.schedulePopUpTime)) {
103478
+ if (!agentConnected || !(agentDetails == null ? void 0 : agentDetails.id)) {
103479
+ popupTimeoutId = setTimeout(() => {
103480
+ if (!agentConnected || !(agentDetails == null ? void 0 : agentDetails.id)) {
103481
+ setPopupVisible(true);
103482
+ }
103483
+ }, company.options.schedulePopUpTime);
103483
103484
  } else {
103484
103485
  setPopupVisible(false);
103485
103486
  }
103486
103487
  }
103488
+ return () => {
103489
+ if (popupTimeoutId) clearTimeout(popupTimeoutId);
103490
+ };
103487
103491
  }, [agentConnected, agentDetails == null ? void 0 : agentDetails.id, (_h = company == null ? void 0 : company.options) == null ? void 0 : _h.schedulePopUpTime, scheduleReminderCanceled, setPopupVisible]);
103488
103492
  const [, colors] = useToken();
103489
103493
  useSocketListeners({ listeners });