@rh-support/react-context 2.5.12 → 2.5.14
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChatInit.d.ts","sourceRoot":"","sources":["../../../src/hooks/useChatInit.ts"],"names":[],"mappings":"AAOA,UAAU,YAAY;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,uBAAuB,EAAE,OAAO,CAAC;IACjC,kBAAkB,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,kBAAkB,OAAO,KAAW,
|
|
1
|
+
{"version":3,"file":"useChatInit.d.ts","sourceRoot":"","sources":["../../../src/hooks/useChatInit.ts"],"names":[],"mappings":"AAOA,UAAU,YAAY;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,uBAAuB,EAAE,OAAO,CAAC;IACjC,kBAAkB,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,kBAAkB,OAAO,KAAW,YA0H3D,CAAC"}
|
|
@@ -48,6 +48,7 @@ export const useChatInit = (initialState = false) => {
|
|
|
48
48
|
}
|
|
49
49
|
catch (e) {
|
|
50
50
|
console.error('Error: Chat service not available', e.message);
|
|
51
|
+
setLoadingChat(false);
|
|
51
52
|
}
|
|
52
53
|
});
|
|
53
54
|
initChatService();
|
|
@@ -61,10 +62,19 @@ export const useChatInit = (initialState = false) => {
|
|
|
61
62
|
const onStartChat = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
63
|
setLoadingChat(true);
|
|
63
64
|
try {
|
|
65
|
+
// if chat didn't start after a long wait
|
|
66
|
+
// then we assume browser has blocked the script
|
|
67
|
+
const blockedTimeOut = setTimeout(() => {
|
|
68
|
+
if (!window.$Lightning) {
|
|
69
|
+
setHasBlockedByBrowser(true);
|
|
70
|
+
setLoadingChat(false);
|
|
71
|
+
}
|
|
72
|
+
}, 10000);
|
|
64
73
|
yield window.embedded_svc.liveAgentAPI.startChat({
|
|
65
74
|
extraPrechatInfo: extraPreChatInfo,
|
|
66
75
|
extraPrechatFormDetails: getChatFormDetails(),
|
|
67
76
|
});
|
|
77
|
+
clearTimeout(blockedTimeOut);
|
|
68
78
|
setHasBlockedByBrowser(false);
|
|
69
79
|
setChatStart(true);
|
|
70
80
|
setLoadingChat(false);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/react-context",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.14",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"lib/**/*"
|
|
27
27
|
],
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@cee-eng/hydrajs": "4.
|
|
29
|
+
"@cee-eng/hydrajs": "4.18.33",
|
|
30
30
|
"@patternfly/react-core": "5.4.2",
|
|
31
31
|
"@patternfly/react-icons": "5.4.2",
|
|
32
32
|
"i18next": "^23.15.0",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"react-test-renderer": "18.2.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@cee-eng/hydrajs": "4.
|
|
40
|
+
"@cee-eng/hydrajs": "4.18.33",
|
|
41
41
|
"@patternfly/react-core": "5.4.2",
|
|
42
42
|
"@patternfly/react-icons": "5.4.2",
|
|
43
|
-
"@rh-support/components": "2.5.
|
|
43
|
+
"@rh-support/components": "2.5.12",
|
|
44
44
|
"@rh-support/types": "2.0.5",
|
|
45
|
-
"@rh-support/user-permissions": "2.5.
|
|
46
|
-
"@rh-support/utils": "2.5.
|
|
45
|
+
"@rh-support/user-permissions": "2.5.6",
|
|
46
|
+
"@rh-support/utils": "2.5.6",
|
|
47
47
|
"i18next": "^23.15.0",
|
|
48
48
|
"localforage": "^1.10.0",
|
|
49
49
|
"lodash": "^4.17.21",
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"defaults and supports es6-module",
|
|
94
94
|
"maintained node versions"
|
|
95
95
|
],
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "546b242324a0f5c12db8e448ed7ce8f374e48105"
|
|
97
97
|
}
|