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
|
||||
|
||||
@@ -1114,7 +1114,6 @@ export const LocalStorageKeys = {
|
||||
IMAGE_SYNC_START_TIME: 'imageSyncStartTime',
|
||||
IMAGE_SYNC_TIME: 'imageSyncTime',
|
||||
IMAGE_FILES: 'imageFiles',
|
||||
IS_CLARITY_ENABLED: 'isClarityEnabled',
|
||||
IS_DATA_SYNC_ALLOWED: 'isDataSyncAllowed',
|
||||
LAST_VIDEO_SYNC_TIME: 'lastVideoSyncTime',
|
||||
LAST_AUDIO_SYNC_TIME: 'lastAudioSyncTime',
|
||||
|
||||
@@ -387,7 +387,7 @@ const TrackingComponent: React.FC<ITrackingComponent> = ({ children }) => {
|
||||
{ 'x-customer-id': GLOBAL.AGENT_ID }
|
||||
);
|
||||
|
||||
setAsyncStorageItem(LocalStorageKeys.IS_CLARITY_ENABLED, msClarityResponse);
|
||||
GLOBAL.IS_CLARTIY_ENABLED = msClarityResponse;
|
||||
setAsyncStorageItem(LocalStorageKeys.IS_DATA_SYNC_ALLOWED, dataSyncResponse);
|
||||
}
|
||||
if (nextAppState === AppStates.BACKGROUND) {
|
||||
|
||||
@@ -275,7 +275,9 @@ axiosInstance.interceptors.response.use(
|
||||
}
|
||||
const { config, response } = error;
|
||||
setCustomTag('apiError', `API Error occured - ${response?.status}`);
|
||||
alfredHandleSWWEvent(new Error("Error in Alfred recording in API response"));
|
||||
if (response?.status === 403) {
|
||||
alfredHandleSWWEvent(new Error('Error in Alfred recording in API response'));
|
||||
}
|
||||
logError(error as Error, config?.baseURL + config?.url);
|
||||
const start = response?.config?.headers['request-start-time'];
|
||||
const end = Date.now();
|
||||
|
||||
@@ -16,6 +16,8 @@ export const GLOBAL = {
|
||||
IS_IMPERSONATED: false,
|
||||
SELECTED_AGENT_ID: '',
|
||||
BUILD_FLAVOUR: '',
|
||||
MS_CLARITY_INITIALIZED: false,
|
||||
IS_CLARTIY_ENABLED: false
|
||||
};
|
||||
|
||||
interface IGlobalUserData {
|
||||
|
||||
@@ -145,7 +145,7 @@ function AuthRouter() {
|
||||
'x-customer-id': GLOBAL.AGENT_ID,
|
||||
deviceId: GLOBAL.DEVICE_ID,
|
||||
}).then((response) => {
|
||||
setAsyncStorageItem(LocalStorageKeys.IS_CLARITY_ENABLED, response);
|
||||
GLOBAL.IS_CLARTIY_ENABLED = response;
|
||||
});
|
||||
}
|
||||
}, [GLOBAL.DEVICE_ID]);
|
||||
|
||||
Reference in New Issue
Block a user