diff --git a/app/components/UI/OptinMetrics/index.js b/app/components/UI/OptinMetrics/index.js index 004690410e3..ba2ec7added 100644 --- a/app/components/UI/OptinMetrics/index.js +++ b/app/components/UI/OptinMetrics/index.js @@ -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 @@ -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); }