react-freshchat
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -122,3 +122,3 @@ (function (global, factory) { | ||
if (this.isEmpty()) { | ||
if (this.isEmpty) { | ||
this.reset(); | ||
@@ -144,4 +144,2 @@ } | ||
} | ||
this.reset(); | ||
} | ||
@@ -189,3 +187,3 @@ }, { | ||
return console.info(' QUEUE', method, args) || earlyCalls.queue({ method: method, args: args }); | ||
return earlyCalls.queue({ method: method, args: args }); | ||
}; | ||
@@ -195,2 +193,4 @@ }; | ||
var loadScript = function loadScript() { | ||
var id = 'freshchat-lib'; | ||
if (document.getElementById(id)) return; | ||
var script = document.createElement('script'); | ||
@@ -200,2 +200,3 @@ script.async = 'true'; | ||
script.src = 'https://wchat.freshchat.com/js/widget.js'; | ||
script.id = id; | ||
document.head.appendChild(script); | ||
@@ -253,7 +254,5 @@ }; | ||
try { | ||
console.info(' - LOADED'); | ||
earlyCalls.dequeueAll(function (method, value) { | ||
var _window$fcWidget; | ||
console.info(' DEQUEUING', method, value); | ||
(_window$fcWidget = window.fcWidget)[method].apply(_window$fcWidget, _toConsumableArray(value)); | ||
@@ -272,2 +271,7 @@ }); | ||
} | ||
}, { | ||
key: 'componentWillUnmount', | ||
value: function componentWillUnmount() { | ||
widget().close(); | ||
} | ||
}]); | ||
@@ -274,0 +278,0 @@ |
{ | ||
"name": "react-freshchat", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "FreshChat React implementation", | ||
@@ -5,0 +5,0 @@ "main": "build/react-freshchat.js", |
@@ -6,3 +6,3 @@ # react-freshchat | ||
## TODO | ||
* Unit Testing && Add this: https://github.com/smartprocure/futil-js/blob/master/circle.yml#L17-L28 | ||
* Transpile to ES5 | ||
* Unit Testing | ||
* Integrate Webpack |
@@ -18,3 +18,3 @@ import _ from 'lodash/fp' | ||
if (this.isEmpty()) { | ||
if (this.isEmpty) { | ||
this.reset() | ||
@@ -40,4 +40,2 @@ } | ||
} | ||
this.reset() | ||
} | ||
@@ -68,6 +66,7 @@ | ||
let queueMethod = method => (...args) => | ||
console.info(' QUEUE', method, args) || earlyCalls.queue({ method, args }) | ||
let queueMethod = method => (...args) => earlyCalls.queue({ method, args }) | ||
let loadScript = () => { | ||
let id = 'freshchat-lib' | ||
if (document.getElementById(id)) return | ||
let script = document.createElement('script') | ||
@@ -77,2 +76,3 @@ script.async = 'true' | ||
script.src = 'https://wchat.freshchat.com/js/widget.js' | ||
script.id = id | ||
document.head.appendChild(script) | ||
@@ -120,5 +120,3 @@ } | ||
try { | ||
console.info(' - LOADED') | ||
earlyCalls.dequeueAll((method, value) => { | ||
console.info(' DEQUEUING', method, value) | ||
window.fcWidget[method](...value) | ||
@@ -136,2 +134,6 @@ }) | ||
} | ||
componentWillUnmount() { | ||
widget().close() | ||
} | ||
} | ||
@@ -138,0 +140,0 @@ |
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
385
15572