Skip to content

Commit

Permalink
Tidy up beacon consent
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansturmer committed Oct 24, 2017
1 parent 3bc7e20 commit 398dbe6
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -698,13 +698,23 @@ Updater.prototype.start = function(callback) {
interval : BEACON_INTERVAL
});

if (consent != "false"){
this.beacon.set("consent_for_beacon", "true");
log.info("Beacon is enabled");
} else {
this.beacon.set("consent_for_beacon", "false");
log.info("Beacon is disabled");
}
switch(consent) {
case "true":
case true:
log.info("Beacon is enabled");
this.beacon.set("consent_for_beacon", "true");
break;

case "false":
case false:
log.info("Beacon is disabled");
this.beacon.set("consent_for_beacon", "false");
break;
default:
log.info("Beacon consent is unspecified");
this.beacon.set("consent_for_beacon", "false");
break;
}
this.beacon.start();
}.bind(this)
],
Expand Down

0 comments on commit 398dbe6

Please sign in to comment.