Skip to content

Commit

Permalink
feat: add loading when categories empty
Browse files Browse the repository at this point in the history
  • Loading branch information
ArekChr committed Feb 14, 2024
1 parent 3914f71 commit b59fe2c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/pages/workspace/categories/WorkspaceCategoriesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, {useMemo, useState} from 'react';
import {View} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import type {OnyxEntry} from 'react-native-onyx';
import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import Icon from '@components/Icon';
import * as Expensicons from '@components/Icon/Expensicons';
Expand Down Expand Up @@ -83,6 +84,10 @@ function WorkspaceCategoriesPage({policyCategories}: WorkspaceCategoriesPageProp
}
};

if (Object.keys(policyCategories ?? {}).length === 0) {
return <FullScreenLoadingIndicator />;
}

return (
<ScreenWrapper
includeSafeAreaPaddingBottom={false}
Expand Down

0 comments on commit b59fe2c

Please sign in to comment.