diff --git a/src/screens/settings/ServerSettings.tsx b/src/screens/settings/ServerSettings.tsx index a48ae391..b1279ec3 100644 --- a/src/screens/settings/ServerSettings.tsx +++ b/src/screens/settings/ServerSettings.tsx @@ -7,7 +7,7 @@ */ import { useTranslation, Trans } from 'react-i18next'; -import { useContext, useEffect } from 'react'; +import { useContext, useEffect, useMemo } from 'react'; import Link from '@mui/material/Link'; import List from '@mui/material/List'; import ListItem from '@mui/material/ListItem'; @@ -106,24 +106,8 @@ export const ServerSettings = () => { mutateSettings({ variables: { input: { settings: { [setting]: value } } } }); }; - if (loading) { - return ; - } - - if (error) { - return ( - refetch().catch(defaultPromiseErrorHandler('ServerSettings::refetch'))} - /> - ); - } - - const serverSettings = extractServerSettings(data!.settings); - - return ( - + const localSettings = useMemo( + () => ( @@ -138,6 +122,37 @@ export const ServerSettings = () => { placeholder="http://localhost:4567" /> + ), + [], + ); + + if (loading) { + return ( + <> + {localSettings} + + + ); + } + + if (error) { + return ( + <> + {localSettings} + refetch().catch(defaultPromiseErrorHandler('ServerSettings::refetch'))} + /> + + ); + } + + const serverSettings = extractServerSettings(data!.settings); + + return ( + + {localSettings}