TP-86072 | Removed Clarity (#957)
This commit is contained in:
@@ -11,7 +11,6 @@ import { getAppVersion } from '../components/utlis/commonFunctions';
|
||||
import { COLORS } from '../../RN-UI-LIB/src/styles/colors';
|
||||
import { handleCrash } from '../components/utlis/DeviceUtils';
|
||||
import crashlytics from '@react-native-firebase/crashlytics';
|
||||
import { setCustomTag } from 'react-native-clarity';
|
||||
import { getCurrentScreen } from '@components/utlis/navigationUtlis';
|
||||
|
||||
interface IErrorBoundary {
|
||||
@@ -39,7 +38,6 @@ class ErrorBoundary extends Component<IErrorBoundary, IErrorBoundaryState> {
|
||||
});
|
||||
logError(error);
|
||||
crashlytics().recordError(error);
|
||||
setCustomTag('jsError', error?.message?.slice(0, 255));
|
||||
handleCrash({ message: error?.message?.slice(0, 255), screenName: getCurrentScreen()?.name });
|
||||
}
|
||||
|
||||
|
||||
@@ -11,20 +11,12 @@ import CosmosForegroundService, {
|
||||
} from '../services/foregroundServices/foreground.service';
|
||||
import useIsOnline from '../hooks/useIsOnline';
|
||||
import { getSyncTime, sendCurrentGeolocationAndBuffer } from '../hooks/capturingApi';
|
||||
import {
|
||||
isTimeDifferenceWithinRange,
|
||||
setAsyncStorageItem,
|
||||
} from '../components/utlis/commonFunctions';
|
||||
import { isTimeDifferenceWithinRange } from '../components/utlis/commonFunctions';
|
||||
import { setIsTimeSynced } from '../reducer/foregroundServiceSlice';
|
||||
import { logError } from '../components/utlis/errorUtils';
|
||||
import { useAppDispatch, useAppSelector } from '../hooks';
|
||||
import { dataSyncService } from '../services/dataSync.service';
|
||||
import {
|
||||
DATA_SYNC_TIME_INTERVAL,
|
||||
ENV,
|
||||
IS_DATA_SYNC_REQUIRED,
|
||||
MS_CLARITY_PROJECT_ID,
|
||||
} from '../constants/config';
|
||||
import { DATA_SYNC_TIME_INTERVAL, IS_DATA_SYNC_REQUIRED } from '../constants/config';
|
||||
import useIsLocationEnabled from '../hooks/useIsLocationEnabled';
|
||||
import {
|
||||
type ISyncCaseIdPayload,
|
||||
@@ -59,16 +51,10 @@ import { addClickstreamEvent } from '../services/clickstreamEventService';
|
||||
import { CLICKSTREAM_EVENT_NAMES, LocalStorageKeys } from './Constants';
|
||||
import useResyncFirebase from '@hooks/useResyncFirebase';
|
||||
import { imageSyncService, sendImagesToServer } from '@services/imageSyncService';
|
||||
import getLitmusExperimentResult, {
|
||||
LitmusExperimentName,
|
||||
LitmusExperimentNameMap,
|
||||
} from '@services/litmusExperiments.service';
|
||||
import { GLOBAL } from '@constants/Global';
|
||||
import { sendAudiosToServer } from '@services/audioSyncService';
|
||||
import { sendVideosToServer } from '@services/videoSyncService';
|
||||
import { getSyncUrl } from '@services/syncJsonDataToBe';
|
||||
import { handleCheckAndUpdatePullToRefreshStateForNearbyCases } from '@screens/allCases/utils';
|
||||
import { initialize } from 'react-native-clarity';
|
||||
import { getWifiDetailsSyncUrl } from '@components/utlis/WifiDetails';
|
||||
import useFirestoreUpdates from '@hooks/useFirestoreUpdates';
|
||||
|
||||
@@ -389,22 +375,6 @@ const TrackingComponent: React.FC<ITrackingComponent> = ({ children }) => {
|
||||
dispatch(getConfigData());
|
||||
CosmosForegroundService.start(tasks);
|
||||
resyncFirebase();
|
||||
const msClarityResponse = await getLitmusExperimentResult(
|
||||
LitmusExperimentNameMap[LitmusExperimentName.MS_CLARITY],
|
||||
{ deviceId: GLOBAL.DEVICE_ID }
|
||||
);
|
||||
if (
|
||||
MS_CLARITY_PROJECT_ID &&
|
||||
!GLOBAL.MS_CLARITY_INITIALIZED &&
|
||||
msClarityResponse &&
|
||||
ENV === 'prod'
|
||||
) {
|
||||
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.MS_CLARITY_INITIALIZED, {
|
||||
deviceId: GLOBAL.DEVICE_ID,
|
||||
});
|
||||
initialize(MS_CLARITY_PROJECT_ID);
|
||||
GLOBAL.MS_CLARITY_INITIALIZED = true;
|
||||
}
|
||||
}
|
||||
if (nextAppState === AppStates.BACKGROUND) {
|
||||
await setItem(StorageKeys.APP_BACKGROUND_TIMESTAMP, now);
|
||||
|
||||
@@ -15,7 +15,6 @@ import {
|
||||
} from '../../common/Constants';
|
||||
import { ToastMessages } from '../../screens/allCases/constants';
|
||||
import { alfredHandleSWWEvent } from './DeviceUtils';
|
||||
import { setCustomTag } from 'react-native-clarity';
|
||||
|
||||
export enum ApiKeys {
|
||||
GENERATE_OTP = 'GENERATE_OTP',
|
||||
@@ -310,7 +309,6 @@ axiosInstance.interceptors.response.use(
|
||||
});
|
||||
}
|
||||
const { config, response } = error;
|
||||
setCustomTag('apiError', `API Error occured - ${response?.status}`);
|
||||
if (response?.status === 400) {
|
||||
alfredHandleSWWEvent(new Error('API Error occured'));
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { buildFlavour } from '@reducers/metadataSlice';
|
||||
import { isNullOrUndefined } from '../components/utlis/commonFunctions';
|
||||
import { setItem } from '@components/utlis/storageHelper';
|
||||
import { setCustomUserId } from 'react-native-clarity';
|
||||
|
||||
export enum DEVICE_TYPE_ENUM {
|
||||
MOBILE = 'MOBILE',
|
||||
@@ -55,12 +54,6 @@ export const setGlobalBuildFlavour = (buildFlavour: buildFlavour) => {
|
||||
if (buildFlavour) GLOBAL.BUILD_FLAVOUR = buildFlavour;
|
||||
};
|
||||
|
||||
export const setMsClarityConfig = (clarityConfig: IClarityConfiguration) => {
|
||||
if (clarityConfig?.customUserId) {
|
||||
setCustomUserId(clarityConfig.customUserId);
|
||||
}
|
||||
};
|
||||
|
||||
export const DOCUMENT_NOT_AVAILABLE = 'Document not available';
|
||||
export const DOCUMENT_DOWNLOAD_STARTED = 'Downloading has started';
|
||||
export const CUSTOMER_PROFILE_IMAGE = 'Customer Profile Image';
|
||||
|
||||
@@ -4,12 +4,7 @@ import { getUniqueId, isTablet } from 'react-native-device-info';
|
||||
import { useAppDispatch, useAppSelector } from '../../hooks';
|
||||
import { type RootState } from '../../store/store';
|
||||
import { setAgentAttendance, setDeviceId } from '../../reducer/userSlice';
|
||||
import {
|
||||
DEVICE_TYPE_ENUM,
|
||||
GLOBAL,
|
||||
setGlobalUserData,
|
||||
setMsClarityConfig,
|
||||
} from '../../constants/Global';
|
||||
import { DEVICE_TYPE_ENUM, setGlobalUserData } from '../../constants/Global';
|
||||
import { registerNavigateAndDispatch } from '../../components/utlis/apiHelper';
|
||||
import ProtectedRouter from './ProtectedRouter';
|
||||
import useNativeButtons from '../../hooks/useNativeButton';
|
||||
@@ -25,19 +20,11 @@ import {
|
||||
alfredSetPhoneNumber,
|
||||
alfredSetUserId,
|
||||
} from '../../components/utlis/DeviceUtils';
|
||||
import { getAppVersion, setAsyncStorageItem } from '../../components/utlis/commonFunctions';
|
||||
import { getAppVersion } from '../../components/utlis/commonFunctions';
|
||||
import useScreenshotTracking from '../../hooks/useScreenshotTracking';
|
||||
import { getSyncTime } from '@hooks/capturingApi';
|
||||
import getLitmusExperimentResult, {
|
||||
LitmusExperimentName,
|
||||
LitmusExperimentNameMap,
|
||||
} from '@services/litmusExperiments.service';
|
||||
import { CLICKSTREAM_EVENT_NAMES, LocalStorageKeys } from '@common/Constants';
|
||||
import ModalWrapperForAlfredV2 from '@common/ModalWrapperForAlfredV2';
|
||||
import IdCardApproved from '@screens/AgentIdCard/IdCardStatus/IdCardApproved';
|
||||
import { ENV, MS_CLARITY_PROJECT_ID } from '@constants/config';
|
||||
import { initialize } from 'react-native-clarity';
|
||||
import { addClickstreamEvent } from '@services/clickstreamEventService';
|
||||
import CallingFeedbackNudgeBottomSheet from '@screens/caseDetails/CallingFlow/BottomSheets/CallingFeedbackNudgeBottomSheet';
|
||||
|
||||
function AuthRouter() {
|
||||
@@ -122,8 +109,6 @@ function AuthRouter() {
|
||||
selectedAgentId: user?.selectedAgent?.referenceId,
|
||||
});
|
||||
|
||||
setMsClarityConfig({ customUserId: user?.user?.referenceId });
|
||||
|
||||
// Sets the dispatch for apiHelper
|
||||
registerNavigateAndDispatch(dispatch);
|
||||
|
||||
@@ -138,20 +123,6 @@ function AuthRouter() {
|
||||
}
|
||||
}, [isLoggedIn]);
|
||||
|
||||
useEffect(() => {
|
||||
if (deviceId) {
|
||||
getLitmusExperimentResult(LitmusExperimentNameMap[LitmusExperimentName.MS_CLARITY], {
|
||||
deviceId: deviceId,
|
||||
}).then((response) => {
|
||||
if (MS_CLARITY_PROJECT_ID && !GLOBAL.MS_CLARITY_INITIALIZED && response && ENV === 'prod') {
|
||||
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.MS_CLARITY_INITIALIZED, { deviceId });
|
||||
initialize(MS_CLARITY_PROJECT_ID);
|
||||
GLOBAL.MS_CLARITY_INITIALIZED = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}, [deviceId]);
|
||||
|
||||
// Firebase cloud messaging listener
|
||||
useFCM();
|
||||
useScreenshotTracking();
|
||||
|
||||
Reference in New Issue
Block a user