Show missing loading placeholders
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user