@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.
@@ -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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@axos-web-dev/shared-components",
3
3
  "description": "Axos shared components library for web.",
4
- "version": "1.0.77-patch.40",
4
+ "version": "1.0.77-patch.41",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",