TP-65182 | State change remove from App.tsx

This commit is contained in:
yashmantri
2024-05-10 12:32:34 +05:30
parent ce49a14f13
commit be54ff6572

25
App.tsx
View File

@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react';
import React, { useEffect } from 'react';
import {
AppState,
LogBox,
@@ -6,7 +6,6 @@ import {
PermissionsAndroid,
Platform,
StatusBar,
NativeModules,
} from 'react-native';
import { Provider } from 'react-redux';
import { init as initApm } from '@cobo/apm-rum-react-native';
@@ -76,8 +75,6 @@ const PERMISSION_CHECK_POLL_INTERVAL = 5 * MILLISECONDS_IN_A_SECOND;
function App() {
const [permissions, setPermissions] = React.useState(true);
const [routeName, setRouteName] = useState('Unknown');
const askForPermissions = async () => {
const permissionsToRequest = await getPermissionsToRequest();
if (Platform.OS === 'android') {
@@ -167,19 +164,15 @@ function App() {
ref={navigationRef}
onStateChange={async (state) => {
const currentRouteName = getActiveRouteName(state);
if (routeName !== currentRouteName) {
await analytics().logScreenView({
screen_name: currentRouteName,
screen_class: currentRouteName,
});
await analytics().logScreenView({
screen_name: currentRouteName,
screen_class: currentRouteName,
});
await analytics().logEvent('screen_view', {
screen_name: currentRouteName,
screen_class: currentRouteName,
});
setRouteName(currentRouteName);
}
await analytics().logEvent('screen_view', {
screen_name: currentRouteName,
screen_class: currentRouteName,
});
}}
>
<StatusBar backgroundColor={COLORS.BACKGROUND.INDIGO_DARK} />