Skip to content

Commit

Permalink
Checks on method calls before use
Browse files Browse the repository at this point in the history
  • Loading branch information
jonybur committed Jul 25, 2024
1 parent c21ca73 commit 6eb7ff8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/components/UI/OptinMetrics/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,10 @@ class OptinMetrics extends PureComponent {
} = this.props;
setTimeout(async () => {
const { clearOnboardingEvents, metrics } = this.props;
if (isDataCollectionForMarketingEnabled === null) {
if (
isDataCollectionForMarketingEnabled === null &&
setDataCollectionForMarketing
) {
setDataCollectionForMarketing(false);
}
// if users refuses tracking, get rid of the stored events
Expand All @@ -331,7 +334,10 @@ class OptinMetrics extends PureComponent {
InteractionManager.runAfterInteractions(async () => {
// add traits to user for identification

if (isDataCollectionForMarketingEnabled === null) {
if (
isDataCollectionForMarketingEnabled === null &&
setDataCollectionForMarketing
) {
setDataCollectionForMarketing(false);
}

Expand Down

0 comments on commit 6eb7ff8

Please sign in to comment.