Skip to content

Commit

Permalink
Merge pull request #476 from lorenc-tomasz/bugfix/avoid-clearing-disp…
Browse files Browse the repository at this point in the history
…atcher-when-optout-is-set

Avoid clearing dispatcher when user changes optOut setting
  • Loading branch information
hannesa2 authored Feb 7, 2024
2 parents 3eaf203 + 724c912 commit d0ca63c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion tracker/src/main/java/org/matomo/sdk/Tracker.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ public void reset() {
public void setOptOut(boolean optOut) {
mOptOut = optOut;
getPreferences().edit().putBoolean(PREF_KEY_TRACKER_OPTOUT, optOut).apply();
mDispatcher.clear();
}

/**
Expand Down
1 change: 0 additions & 1 deletion tracker/src/test/java/org/matomo/sdk/TrackerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ public void testsetDispatchGzip() {
public void testOptOut_set() {
Tracker tracker = new Tracker(mMatomo, mTrackerBuilder);
tracker.setOptOut(true);
verify(mDispatcher).clear();
assertTrue(tracker.isOptOut());
tracker.setOptOut(false);
assertFalse(tracker.isOptOut());
Expand Down

0 comments on commit d0ca63c

Please sign in to comment.