react-live-chat-loader
Advanced tools
Comparing version 0.0.21 to 0.0.22
@@ -65,3 +65,3 @@ "use strict"; | ||
}); | ||
}, idleThreshold * 2); | ||
}, idleThreshold); | ||
} | ||
@@ -82,3 +82,3 @@ }, []); | ||
//eslint-disable-next-line no-console | ||
console.error('No api key given to react-live-chat-loader'); | ||
console.error('No provider given to react-live-chat-loader'); | ||
return; | ||
@@ -85,0 +85,0 @@ } |
@@ -32,2 +32,4 @@ "use strict"; | ||
var _providers = _interopRequireDefault(require("./providers")); | ||
var _useChat = _interopRequireDefault(require("./hooks/useChat")); | ||
@@ -60,3 +62,3 @@ | ||
_ref$idlePeriod = _ref.idlePeriod, | ||
idlePeriod = _ref$idlePeriod === void 0 ? 2000 : _ref$idlePeriod, | ||
idlePeriod = _ref$idlePeriod === void 0 ? 3000 : _ref$idlePeriod, | ||
children = _ref.children; | ||
@@ -76,7 +78,19 @@ | ||
}; | ||
var chatProvider = _providers["default"][provider]; | ||
if (!chatProvider) { | ||
//eslint-disable-next-line no-console | ||
console.error("Unkown provider given to react-live-chat-loader: ".concat(provider)); | ||
return; | ||
} | ||
return _react["default"].createElement(LiveChatLoaderContext.Provider, { | ||
value: value | ||
}, children); | ||
}, _react["default"].createElement("link", { | ||
href: chatProvider.domain, | ||
rel: "preconnect", | ||
crossOrigin: "" | ||
}), children); | ||
}; | ||
exports.LiveChatLoaderProvider = LiveChatLoaderProvider; |
@@ -7,2 +7,3 @@ "use strict"; | ||
exports["default"] = void 0; | ||
var domain = 'https://beacon-v2.helpscout.net'; | ||
@@ -15,3 +16,3 @@ var loadScript = function loadScript() { | ||
n = t.createElement('script'); | ||
n.async = !0, n.src = 'https://beacon-v2.helpscout.net', e.parentNode.insertBefore(n, e); | ||
n.async = !0, n.src = domain, e.parentNode.insertBefore(n, e); | ||
} | ||
@@ -45,2 +46,3 @@ | ||
var _default = { | ||
domain: domain, | ||
load: load, | ||
@@ -47,0 +49,0 @@ open: open, |
@@ -7,2 +7,3 @@ "use strict"; | ||
exports["default"] = void 0; | ||
var domain = 'https://widget.intercom.io'; | ||
@@ -25,3 +26,3 @@ var loadScript = function loadScript() { | ||
s.async = true; | ||
s.src = 'https://widget.intercom.io/widget/3qmk5gyg'; | ||
s.src = "".concat(domain, "/widget/3qmk5gyg"); | ||
var x = d.getElementsByTagName('script')[0]; | ||
@@ -66,2 +67,3 @@ x.parentNode.insertBefore(s, x); | ||
var _default = { | ||
domain: domain, | ||
load: load, | ||
@@ -68,0 +70,0 @@ open: open, |
{ | ||
"name": "react-live-chat-loader", | ||
"version": "0.0.21", | ||
"version": "0.0.22", | ||
"description": "Implement live chat in your react app without taking a performance hit.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52303
794