Skip to content

Commit

Permalink
fix track training always displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
nyomanjyotisa committed Jul 26, 2024
1 parent dd03c1e commit 40653d4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pages/TrackExpensePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import * as IOU from '@userActions/IOU';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';

/*
* This is a "utility page", that does this:
Expand All @@ -25,13 +26,14 @@ function TrackExpensePage() {
const styles = useThemeStyles();
const isUnmounted = useRef(false);
const {isOffline} = useNetwork();
const [hasSeenTrackTraining] = useOnyx(ONYXKEYS.NVP_HAS_SEEN_TRACK_TRAINING);
const [hasSeenTrackTraining, hasSeenTrackTrainingResult] = useOnyx(ONYXKEYS.NVP_HAS_SEEN_TRACK_TRAINING);
const isLoadingHasSeenTrackTraining = isLoadingOnyxValue(hasSeenTrackTrainingResult);

useFocusEffect(() => {
interceptAnonymousUser(() => {
App.confirmReadyToOpenApp();
Navigation.isNavigationReady().then(() => {
if (isUnmounted.current) {
if (isUnmounted.current || isLoadingHasSeenTrackTraining) {
return;
}
Navigation.goBack();
Expand Down

0 comments on commit 40653d4

Please sign in to comment.