make sure we dont log the initial call to onBubbleToggled

This commit is contained in:
David Kelly 2017-06-02 08:45:02 -07:00
parent 37b738ff8b
commit 4dae77cd9d

View file

@ -140,11 +140,12 @@
}
// When the space bubble is toggled...
function onBubbleToggled() {
var bubbleActive = Users.getIgnoreRadiusEnabled();
writeButtonProperties(bubbleActive);
UserActivityLogger.bubbleToggled(bubbleActive);
if (bubbleActive) {
function onBubbleToggled(enabled, doNotLog) {
writeButtonProperties(enabled);
if (doNotLog !== true) {
UserActivityLogger.bubbleToggled(enabled);
}
if (enabled) {
createOverlays();
} else {
hideOverlays();
@ -165,7 +166,7 @@
sortOrder: 4
});
onBubbleToggled();
onBubbleToggled(Users.getIgnoreRadiusEnabled(), true); // pass in true so we don't log this initial one in the UserActivity table
button.clicked.connect(Users.toggleIgnoreRadius);
Users.ignoreRadiusEnabledChanged.connect(onBubbleToggled);