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

@@ -21,6 +21,7 @@ import { TextSetting } from '@/components/settings/text/TextSetting.tsx';
import { ServerSettings as GqlServerSettings } from '@/typings.ts';
import { NumberSetting } from '@/components/settings/NumberSetting.tsx';
import { SelectSetting } from '@/components/settings/SelectSetting.tsx';
import { LoadingPlaceholder } from '@/components/util/LoadingPlaceholder.tsx';
type ServerSettingsType = Pick<
GqlServerSettings,
@@ -83,7 +84,7 @@ export const ServerSettings = () => {
};
}, [t]);
const { data } = requestManager.useGetServerSettings();
const { data, loading } = requestManager.useGetServerSettings();
const serverSettings = data ? extractServerSettings(data.settings) : undefined;
const [mutateSettings] = requestManager.useUpdateServerSettings();
@@ -102,6 +103,10 @@ export const ServerSettings = () => {
mutateSettings({ variables: { input: { settings: { [setting]: value } } } });
};
if (loading) {
return <LoadingPlaceholder />;
}
return (
<List>
<List