You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@senssoft.apache.org by rf...@apache.org on 2017/09/18 17:28:14 UTC

[09/21] incubator-senssoft-useralejs git commit: Updated sendOnClose to not send logs if config is off

Updated sendOnClose to not send logs if config is off


Project: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/commit/c66536b1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/tree/c66536b1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/diff/c66536b1

Branch: refs/heads/SENSSOFT-192
Commit: c66536b1ebcb94ecd64801db6a64a7d5ccbe08da
Parents: d96a174
Author: Rob Foley <ro...@gmail.com>
Authored: Wed Sep 13 09:41:23 2017 -0700
Committer: Rob Foley <ro...@gmail.com>
Committed: Wed Sep 13 09:41:23 2017 -0700

----------------------------------------------------------------------
 src/sendLogs.js | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/blob/c66536b1/src/sendLogs.js
----------------------------------------------------------------------
diff --git a/src/sendLogs.js b/src/sendLogs.js
index bbe72a2..c311c46 100644
--- a/src/sendLogs.js
+++ b/src/sendLogs.js
@@ -50,6 +50,10 @@ export function sendOnInterval(logs, config) {
  * @param  {Object} config Configuration object to be read from.
  */
 export function sendOnClose(logs, config) {
+  if (!config.on) {
+    return;
+  }
+
   if (navigator.sendBeacon) {
     window.addEventListener('unload', function() {
       navigator.sendBeacon(config.url, JSON.stringify(logs));