Skip to content

Commit

Permalink
review feedback and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zikaari committed Jan 4, 2024
1 parent 863e3b4 commit 5fd7915
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/core/src/plugins/ConsentPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ export class ConsentPlugin extends Plugin {
let lastDeviceAttrs = analytics.context.get()?.device;
analytics.context.onChange((c) => {
const newAttrs = c?.device;
if (JSON.stringify(lastDeviceAttrs) !== JSON.stringify(newAttrs)) {
if (
newAttrs?.adTrackingEnabled !== lastDeviceAttrs?.adTrackingEnabled ||
newAttrs?.advertisingId !== lastDeviceAttrs?.advertisingId ||
newAttrs?.trackingStatus !== lastDeviceAttrs?.trackingStatus
) {
this.notifyConsentChange();
}
lastDeviceAttrs = newAttrs;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
Context,
DestinationPlugin,
Plugin,
PluginType,
Expand Down Expand Up @@ -192,7 +193,7 @@ describe('OneTrustPlugin', () => {
C004: false,
},
},
}) as unknown,
}) as unknown as Context,
});
});
});

0 comments on commit 5fd7915

Please sign in to comment.