@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
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
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(() => {});
|