Skip to content

Commit

Permalink
fix: remove onyx fetching status const
Browse files Browse the repository at this point in the history
  • Loading branch information
dominictb committed Aug 16, 2024
1 parent f13c83c commit a05957a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,6 @@ const CONST = {
OLD_DOT_ANDROID: 'https://play.google.com/store/apps/details?id=org.me.mobiexpensifyg&hl=en_US&pli=1',
OLD_DOT_IOS: 'https://apps.apple.com/us/app/expensify-expense-tracker/id471713959',
},
ONYX_FETCH_STATUS: {
LOADING: 'loading',
LOADED: 'loaded',
},
DATE: {
SQL_DATE_TIME: 'YYYY-MM-DD HH:mm:ss',
FNS_FORMAT_STRING: 'yyyy-MM-dd',
Expand Down
6 changes: 3 additions & 3 deletions src/libs/Navigation/OnyxTabNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import type {TabSelectorProps} from '@components/TabSelector/TabSelector';
import useThemeStyles from '@hooks/useThemeStyles';
import type {IOURequestType} from '@libs/actions/IOU';
import Tab from '@userActions/Tab';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type {SelectedTabRequest} from '@src/types/onyx';
import type ChildrenProps from '@src/types/utils/ChildrenProps';
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';
import {defaultScreenOptions} from './OnyxTabNavigatorConfig';

type OnyxTabNavigatorProps = ChildrenProps & {
Expand Down Expand Up @@ -66,7 +66,7 @@ function OnyxTabNavigator({
}: OnyxTabNavigatorProps) {
// Mapping of tab name to focus trap container element
const [focusTrapContainerElementMapping, setFocusTrapContainerElementMapping] = useState<Record<string, HTMLElement>>({});
const [selectedTab, {status: onyxFetchStatus}] = useOnyx(`${ONYXKEYS.COLLECTION.SELECTED_TAB}${id}`);
const [selectedTab, onyxFetchMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.SELECTED_TAB}${id}`);

// This callback is used to register the focus trap container element of each avaiable tab screen
const setTabFocusTrapContainerElement = useCallback((tabName: string, containerElement: HTMLElement | null) => {
Expand Down Expand Up @@ -103,7 +103,7 @@ function OnyxTabNavigator({
onActiveTabFocusTrapContainerElementChanged?.(selectedTab ? focusTrapContainerElementMapping[selectedTab] : null);
}, [selectedTab, focusTrapContainerElementMapping, onActiveTabFocusTrapContainerElementChanged]);

if (onyxFetchStatus === CONST.ONYX_FETCH_STATUS.LOADING) {
if (isLoadingOnyxValue(onyxFetchMetadata)) {
return null;
}

Expand Down

0 comments on commit a05957a

Please sign in to comment.