Skip to content

Commit

Permalink
Revert "Update Profile_RootScreen.tsx"
Browse files Browse the repository at this point in the history
This reverts commit 39da7c8.
  • Loading branch information
jorelosorio committed Sep 9, 2024
1 parent 06b6989 commit f4610c9
Showing 1 changed file with 3 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {numberToAccessibilityString} from '@atb/utils/accessibility';
import {useLocalConfig} from '@atb/utils/use-local-config';
import Bugsnag from '@bugsnag/react-native';
import {IS_QA_ENV} from '@env';
import React, { useEffect, useState } from 'react';
import React from 'react';
import {ActivityIndicator, Linking, View} from 'react-native';
import {getBuildNumber, getVersion} from 'react-native-device-info';
import {ProfileScreenProps} from './navigation-types';
Expand All @@ -37,7 +37,7 @@ import {
MessageSectionItem,
Section,
} from '@atb/components/sections';
import auth, {FirebaseAuthTypes} from '@react-native-firebase/auth';

import {ClickableCopy} from './components/ClickableCopy';
import {usePushNotificationsEnabled} from '@atb/notifications';
import {useAnalytics} from '@atb/analytics';
Expand Down Expand Up @@ -83,10 +83,6 @@ export const Profile_RootScreen = ({navigation}: ProfileProps) => {
const inspectionInfoUrl = getTextForLanguage(inspectionInfo, language);
const refundInfoUrl = getTextForLanguage(refundInfo, language);
const a11yStatementUrl = getTextForLanguage(a11yStatement, language);
const user = auth().currentUser;
const [idToken, setIdToken] = useState<
FirebaseAuthTypes.IdTokenResult | undefined
>(undefined);

const {disable_travelcard} = useRemoteConfig();

Expand All @@ -111,17 +107,6 @@ export const Profile_RootScreen = ({navigation}: ProfileProps) => {
});
}

useEffect(() => {
(async function () {
const idToken = await user?.getIdTokenResult();
setIdToken(idToken);
})();
}, [user]);

// If we are not authenticated or we don't have an idToken, we show an error message
// and a button to retry the authentication.
const errorLoadingAccount = authStatus !== 'authenticated' || !idToken;

return (
<>
<FullScreenView
Expand Down Expand Up @@ -168,7 +153,7 @@ export const Profile_RootScreen = ({navigation}: ProfileProps) => {
<ActivityIndicator />
</GenericSectionItem>
)}
{errorLoadingAccount && (
{authStatus !== 'authenticated' && (
<MessageSectionItem
message={t(ProfileTexts.sections.account.infoItems.claimsError)}
messageType="error"
Expand Down

0 comments on commit f4610c9

Please sign in to comment.