Skip to content

Commit 97519f9

Browse files
committed
fix: add loading indicator for status filters page
1 parent 87f945e commit 97519f9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersStatusPage.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {View} from 'react-native';
33
import {useOnyx} from 'react-native-onyx';
44
import Button from '@components/Button';
55
import FixedFooter from '@components/FixedFooter';
6+
import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator';
67
import HeaderWithBackButton from '@components/HeaderWithBackButton';
78
import ScreenWrapper from '@components/ScreenWrapper';
89
import SelectionList from '@components/SelectionList';
@@ -20,7 +21,7 @@ import ROUTES from '@src/ROUTES';
2021
function SearchFiltersStatusPage() {
2122
const styles = useThemeStyles();
2223
const {translate} = useLocalize();
23-
const [searchAdvancedFiltersForm] = useOnyx(ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM, {canBeMissing: true});
24+
const [searchAdvancedFiltersForm, searchAdvancedFiltersFormResult] = useOnyx(ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM, {canBeMissing: true});
2425
const currentType = searchAdvancedFiltersForm?.type ?? CONST.SEARCH.DATA_TYPES.EXPENSE;
2526
const currentGroupBy = searchAdvancedFiltersForm?.groupBy;
2627
const [selectedItems, setSelectedItems] = useState<string[]>(() => {
@@ -73,6 +74,10 @@ function SearchFiltersStatusPage() {
7374
Navigation.goBack(ROUTES.SEARCH_ADVANCED_FILTERS);
7475
}, [selectedItems]);
7576

77+
if (searchAdvancedFiltersFormResult.status === 'loading') {
78+
return <FullScreenLoadingIndicator />;
79+
}
80+
7681
return (
7782
<ScreenWrapper
7883
testID={SearchFiltersStatusPage.displayName}

0 commit comments

Comments
 (0)