TP-72939 | Ms clarity added
This commit is contained in:
18
App.tsx
18
App.tsx
@@ -147,20 +147,20 @@ function App() {
|
||||
checkCodePushAndSync();
|
||||
setForegroundTimeStampAndClickstream();
|
||||
|
||||
if (ENV === 'prod') {
|
||||
getAsyncStorageItem(LocalStorageKeys.IS_CLARITY_ENABLED, true).then((value) => {
|
||||
if (MS_CLARITY_PROJECT_ID && value && !GLOBAL.MS_CLARITY_INITIALIZED) {
|
||||
initialize(MS_CLARITY_PROJECT_ID);
|
||||
GLOBAL.MS_CLARITY_INITIALIZED = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return () => {
|
||||
appStateChange.remove();
|
||||
};
|
||||
}, []);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (ENV === 'prod' && GLOBAL.IS_CLARTIY_ENABLED) {
|
||||
if (MS_CLARITY_PROJECT_ID && !GLOBAL.MS_CLARITY_INITIALIZED) {
|
||||
initialize(MS_CLARITY_PROJECT_ID);
|
||||
GLOBAL.MS_CLARITY_INITIALIZED = true;
|
||||
}
|
||||
}
|
||||
}, [GLOBAL.IS_CLARTIY_ENABLED]);
|
||||
|
||||
return (
|
||||
<Provider store={store}>
|
||||
<PersistGate
|
||||
|
||||
Reference in New Issue
Block a user