@devboldly/react-use-google-analytics-embed-api
Advanced tools
Comparing version 0.0.15 to 0.0.16
@@ -21,3 +21,7 @@ "use strict"; | ||
React.useEffect(function () { | ||
var signInHandler = function () { return (onSignIn ? onSignIn() : undefined); }; | ||
var signInHandler = function () { | ||
if (typeof onSignIn !== 'undefined') { | ||
onSignIn(); | ||
} | ||
}; | ||
var win = window; | ||
@@ -27,2 +31,3 @@ // If a refresh isn't required (since authorize can only be called once) | ||
if (gapiLoader.ready && gapiLoader.gapi) { | ||
gapiLoader.gapi.analytics.auth.on('signIn', signInHandler); | ||
gapiLoader.gapi.analytics.auth.authorize({ | ||
@@ -35,12 +40,6 @@ container: containerId, | ||
win[globalNamespace][refreshedRequiredKeyName] = true; | ||
gapiLoader.gapi.analytics.auth.on('signIn', signInHandler); | ||
} | ||
} | ||
return function () { | ||
if (gapiLoader.ready && gapiLoader.gapi) { | ||
gapiLoader.gapi.analytics.auth.off('signIn', signInHandler); | ||
} | ||
}; | ||
}); | ||
return !!refreshRequired; | ||
}; |
{ | ||
"name": "@devboldly/react-use-google-analytics-embed-api", | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"author": "Dev Boldly <devboldly@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "React hook to async load the Google Analytics Embed API.", |
85267
1919