Rename "ExtensionSettings" to "BrowseSettings" (#600)
This commit is contained in:
@@ -35,7 +35,7 @@ import { DownloadSettings } from '@/screens/settings/DownloadSettings.tsx';
|
||||
import { ServerSettings } from '@/screens/settings/ServerSettings.tsx';
|
||||
import { ServerUpdateChecker } from '@/components/settings/ServerUpdateChecker.tsx';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { ExtensionSettings } from '@/screens/settings/ExtensionSettings.tsx';
|
||||
import { BrowseSettings } from '@/screens/settings/BrowseSettings.tsx';
|
||||
import { WebUISettings } from '@/screens/settings/WebUISettings.tsx';
|
||||
import { Migrate } from '@/screens/Migrate.tsx';
|
||||
|
||||
@@ -101,7 +101,7 @@ export const App: React.FC = () => (
|
||||
<Route path="backup" element={<Backup />} />
|
||||
<Route path="server" element={<ServerSettings />} />
|
||||
<Route path="webUI" element={<WebUISettings />} />
|
||||
<Route path="extensionSettings" element={<ExtensionSettings />} />
|
||||
<Route path="browseSettings" element={<BrowseSettings />} />
|
||||
</Route>
|
||||
|
||||
{/* Manga Routes */}
|
||||
|
||||
@@ -275,8 +275,7 @@
|
||||
"title": "Extension repositories"
|
||||
}
|
||||
}
|
||||
},
|
||||
"title": "Extension Settings"
|
||||
}
|
||||
},
|
||||
"state": {
|
||||
"label": {
|
||||
@@ -684,6 +683,9 @@
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"browse": {
|
||||
"title": "Browse settings"
|
||||
},
|
||||
"about": {
|
||||
"server": {
|
||||
"label": {
|
||||
|
||||
@@ -237,7 +237,7 @@ export function Extensions() {
|
||||
{FileInputComponent}
|
||||
<Stack sx={{ paddingTop: '20px' }} alignItems="center" justifyContent="center" rowGap="10px">
|
||||
<Typography>{t('extension.label.add_repository_info')}</Typography>
|
||||
<Button component={Link} variant="contained" to="/settings/extensionSettings">
|
||||
<Button component={Link} variant="contained" to="/browse/extensionSettings">
|
||||
{t('settings.title')}
|
||||
</Button>
|
||||
</Stack>
|
||||
|
||||
@@ -155,7 +155,7 @@ export function Settings() {
|
||||
secondary={t('settings.clear_cache.label.description')}
|
||||
/>
|
||||
</ListItemButton>
|
||||
<ListItemLink to="/settings/extensionSettings">
|
||||
<ListItemLink to="/settings/browseSettings">
|
||||
<ListItemIcon>
|
||||
<ExploreOutlinedIcon />
|
||||
</ListItemIcon>
|
||||
|
||||
@@ -22,27 +22,27 @@ import { useLocalStorage } from '@/util/useLocalStorage.tsx';
|
||||
|
||||
type ExtensionsSettings = Pick<GqlServerSettings, 'maxSourcesInParallel' | 'localSourcePath' | 'extensionRepos'>;
|
||||
|
||||
const extractExtensionSettings = (settings: GqlServerSettings): ExtensionsSettings => ({
|
||||
const extractBrowseSettings = (settings: GqlServerSettings): ExtensionsSettings => ({
|
||||
maxSourcesInParallel: settings.maxSourcesInParallel,
|
||||
localSourcePath: settings.localSourcePath,
|
||||
extensionRepos: settings.extensionRepos,
|
||||
});
|
||||
|
||||
export const ExtensionSettings = () => {
|
||||
export const BrowseSettings = () => {
|
||||
const { t } = useTranslation();
|
||||
const { setTitle, setAction } = useContext(NavBarContext);
|
||||
|
||||
useSetDefaultBackTo('settings');
|
||||
|
||||
useEffect(() => {
|
||||
setTitle(t('extension.settings.title'));
|
||||
setTitle(t('settings.browse.title'));
|
||||
setAction(null);
|
||||
}, [t]);
|
||||
|
||||
const [showNsfw, setShowNsfw] = useLocalStorage<boolean>('showNsfw', true);
|
||||
|
||||
const { data } = requestManager.useGetServerSettings();
|
||||
const serverSettings = data ? extractExtensionSettings(data.settings) : undefined;
|
||||
const serverSettings = data ? extractBrowseSettings(data.settings) : undefined;
|
||||
const [mutateSettings] = requestManager.useUpdateServerSettings();
|
||||
|
||||
const updateSetting = <Setting extends keyof ExtensionsSettings>(
|
||||
Reference in New Issue
Block a user