@axos-web-dev/shared-components 2.0.0-dev.4 → 2.0.0-dev.4-fix-0
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 -9
- package/package.json +1 -1
package/dist/Chatbot/Chatbot.js
CHANGED
|
@@ -11,14 +11,16 @@ import { useOpenChat } from "./store/chat.js";
|
|
|
11
11
|
import { useMessages } from "./store/messages.js";
|
|
12
12
|
const __vite_import_meta_env__ = { "VITE_COMPANY_ID": "17524785112945485a16ec8e771737dce", "VITE_HOST": "https://axccaipdev-i3ofmup.uc1.ccaiplatform.com", "VITE_TENANT_NAME": "axccaipdev-i3ofmup" };
|
|
13
13
|
const env = __vite_import_meta_env__ || process.env;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
if (typeof window !== "undefined") {
|
|
15
|
+
const OriginalAudio = window.Audio;
|
|
16
|
+
class PatchedAudio extends OriginalAudio {
|
|
17
|
+
constructor(src) {
|
|
18
|
+
const newSrc = src === "https://websdk.ujet.co/v3/ping.mp3" ? notificationSound : src;
|
|
19
|
+
super(newSrc);
|
|
20
|
+
}
|
|
19
21
|
}
|
|
22
|
+
window.Audio = PatchedAudio;
|
|
20
23
|
}
|
|
21
|
-
window.Audio = PatchedAudio;
|
|
22
24
|
const Chatbot = ({
|
|
23
25
|
project = "axos",
|
|
24
26
|
projectEnv = "dev",
|
|
@@ -287,14 +289,14 @@ const Chatbot = ({
|
|
|
287
289
|
console.error("Error creating chat:", err);
|
|
288
290
|
} finally {
|
|
289
291
|
if (clientRef?.current?.chat?.state?.status == "va_assigned") {
|
|
290
|
-
const
|
|
291
|
-
class
|
|
292
|
+
const OriginalAudio = window.Audio;
|
|
293
|
+
class PatchedAudio extends OriginalAudio {
|
|
292
294
|
constructor(src) {
|
|
293
295
|
const newSrc = src === "https://websdk.ujet.co/v3/ping.mp3" ? notificationSound : src;
|
|
294
296
|
super(newSrc);
|
|
295
297
|
}
|
|
296
298
|
}
|
|
297
|
-
window.Audio =
|
|
299
|
+
window.Audio = PatchedAudio;
|
|
298
300
|
}
|
|
299
301
|
}
|
|
300
302
|
};
|
package/package.json
CHANGED