react-freshchat
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -185,3 +185,2 @@ (function (global, factory) { | ||
console.info('Queing', method); | ||
earlyCalls.queue({ method: method, args: args }); | ||
@@ -194,3 +193,2 @@ }; | ||
if (document.getElementById(id) || window.fcWidget) return; | ||
console.info('Loading FreshChat Lib'); | ||
var script = document.createElement('script'); | ||
@@ -212,4 +210,2 @@ script.async = 'true'; | ||
console.info('FreshChat Component :)'); | ||
var token = props.token, | ||
@@ -241,2 +237,5 @@ moreProps = _objectWithoutProperties(props, ['token']); | ||
window.fcWidget.init(settings); | ||
if (settings.onInit) { | ||
settings.onInit(); | ||
} | ||
} else { | ||
@@ -249,3 +248,3 @@ this.lazyInit(settings); | ||
value: function lazyInit(settings) { | ||
widget().init(settings); | ||
widget().init(settings); // Can't use window.fcSettings because sometimes it doesn't work | ||
@@ -266,2 +265,5 @@ loadScript(); | ||
} | ||
if (settings.onInit) { | ||
settings.onInit(); | ||
} | ||
} | ||
@@ -268,0 +270,0 @@ }, 1000); |
{ | ||
"name": "react-freshchat", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "FreshChat React implementation", | ||
@@ -5,0 +5,0 @@ "main": "build/react-freshchat.js", |
@@ -65,3 +65,2 @@ import _ from 'lodash/fp' | ||
let queueMethod = method => (...args) => { | ||
console.info('Queing', method) | ||
earlyCalls.queue({ method, args }) | ||
@@ -73,3 +72,2 @@ } | ||
if (document.getElementById(id) || window.fcWidget) return | ||
console.info('Loading FreshChat Lib') | ||
let script = document.createElement('script') | ||
@@ -87,4 +85,2 @@ script.async = 'true' | ||
console.info('FreshChat Component :)') | ||
let { token, ...moreProps } = props | ||
@@ -111,2 +107,5 @@ | ||
window.fcWidget.init(settings) | ||
if (settings.onInit) { | ||
settings.onInit() | ||
} | ||
} else { | ||
@@ -118,3 +117,3 @@ this.lazyInit(settings) | ||
lazyInit(settings) { | ||
widget().init(settings) | ||
widget().init(settings) // Can't use window.fcSettings because sometimes it doesn't work | ||
@@ -133,2 +132,5 @@ loadScript() | ||
} | ||
if (settings.onInit) { | ||
settings.onInit() | ||
} | ||
} | ||
@@ -135,0 +137,0 @@ }, 1000) |
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
17150
399