@axos-web-dev/shared-components 1.0.77-patch.40 → 1.0.77-patch.41
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/Chatbot/Chatbot.js +11 -0
- package/package.json +1 -1
package/dist/Chatbot/Chatbot.js
CHANGED
|
@@ -144,6 +144,17 @@ const Chatbot = ({
|
|
|
144
144
|
console.log("Starting chat");
|
|
145
145
|
const client = clientRef.current;
|
|
146
146
|
if (!client) return;
|
|
147
|
+
if (!menuRef.current || !menuRef.current.menus) {
|
|
148
|
+
let waited = 0;
|
|
149
|
+
while ((!menuRef.current || !menuRef.current.menus) && waited < 2e3) {
|
|
150
|
+
await new Promise((res) => setTimeout(res, 100));
|
|
151
|
+
waited += 100;
|
|
152
|
+
}
|
|
153
|
+
if (!menuRef.current || !menuRef.current.menus) {
|
|
154
|
+
console.error("Menu not loaded, cannot start chat");
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
147
158
|
try {
|
|
148
159
|
const ongoingChat = await client.loadOngoingChat();
|
|
149
160
|
if (ongoingChat) {
|
package/package.json
CHANGED