Show missing loading placeholders

This commit is contained in:
schroda
2024-04-27 16:24:55 +02:00
parent 35b756e09c
commit 626c4ba6e6
9 changed files with 52 additions and 7 deletions

View File

@@ -34,6 +34,7 @@ import { StrictModeDroppable } from '@/lib/StrictModeDroppable';
import { DEFAULT_FULL_FAB_HEIGHT } from '@/components/util/StyledFab';
import { NavBarContext, useSetDefaultBackTo } from '@/components/context/NavbarContext';
import { TCategory } from '@/typings.ts';
import { LoadingPlaceholder } from '@/components/util/LoadingPlaceholder.tsx';
const getItemStyle = (
isDragging: boolean,
@@ -62,7 +63,7 @@ export function Categories() {
};
}, [t]);
const { data } = requestManager.useGetCategories();
const { data, loading } = requestManager.useGetCategories({ notifyOnNetworkStatusChange: true });
const categories = useMemo(() => {
const res = [...(data?.categories.nodes ?? [])];
if (res.length > 0 && res[0].name === 'Default') {
@@ -135,6 +136,10 @@ export function Categories() {
requestManager.deleteCategory(category.id);
};
if (loading) {
return <LoadingPlaceholder />;
}
return (
<>
<DragDropContext onDragEnd={onDragEnd}>