@flowengage/react-chatbot 5.0.19 → 5.0.22

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.
@@ -3243,12 +3243,16 @@ function Nr({ siteId: e, config: t, children: n, language: r = "en" }) {
3243
3243
  }, [Fe, _]);
3244
3244
  let Bt = p(null);
3245
3245
  c(() => {
3246
- if (Bt.current === !0 && !C) {
3247
- let e = A.current, t = k.current;
3248
- t && e && t.updateChatStatus(e, "widget_closed").catch(() => {});
3249
- }
3250
- Bt.current = C;
3251
- }, [C]), c(() => {
3246
+ let e = k.current;
3247
+ !e || !y || Bt.current !== C && (C ? e.updateChatStatus(y, "open").catch(() => {}) : Bt.current === !0 && e.updateChatStatus(y, "widget_closed").catch(() => {}), Bt.current = C);
3248
+ }, [C, y]), c(() => {
3249
+ if (!C || !y) return;
3250
+ let e = setInterval(() => {
3251
+ let e = k.current;
3252
+ e && y && e.updateChatStatus(y, "widget_heartbeat").catch(() => {});
3253
+ }, 1e4);
3254
+ return () => clearInterval(e);
3255
+ }, [C, y]), c(() => {
3252
3256
  let e = () => {
3253
3257
  let e = A.current, t = k.current;
3254
3258
  !e || !t || typeof navigator > "u" || t.beaconWidgetClosed?.(e) || t.updateChatStatus(e, "widget_closed").catch(() => {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowengage/react-chatbot",
3
- "version": "5.0.19",
3
+ "version": "5.0.22",
4
4
  "description": "Embeddable AI chat widget for React — powered by FlowEngage. Drop it in with a single siteId.",
5
5
  "keywords": [
6
6
  "chatbot",