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

@@ -18,6 +18,7 @@ import { EditTextPreference } from '@/components/sourceConfiguration/EditTextPre
import { MultiSelectListPreference } from '@/components/sourceConfiguration/MultiSelectListPreference';
import { PreferenceProps } from '@/typings.ts';
import { NavBarContext } from '@/components/context/NavbarContext.tsx';
import { LoadingPlaceholder } from '@/components/util/LoadingPlaceholder.tsx';
function getPrefComponent(type: string) {
switch (type) {
@@ -51,7 +52,7 @@ export function SourceConfigure() {
}, [t]);
const { sourceId } = useParams<{ sourceId: string }>();
const { data } = requestManager.useGetSource(sourceId);
const { data, loading } = requestManager.useGetSource(sourceId);
const sourcePreferences = data?.source.preferences ?? [];
const updateValue =
@@ -60,6 +61,10 @@ export function SourceConfigure() {
requestManager.setSourcePreferences(sourceId, { position, [type]: value });
};
if (loading) {
return <LoadingPlaceholder />;
}
return (
<List sx={{ padding: 0 }}>
{sourcePreferences.map((it, index) => {