mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2026-03-04 02:20:19 +01:00
added a flag to hide settings (#5263)
Added an optional flag in settings.yml to hide the settings button in no login servers. When hidden, users can no longer: - Open the Settings modal at all (gear button is hidden) - Change General preferences (tool picker mode, hide unavailable tools/conversions, auto‑unzip and file limit) - Configure keyboard shortcuts (Hotkeys / Keyboard Shortcuts section) - Use the in‑app update checker UI (see current/latest version, check for updates, view update details) - Note: When enableLogin === true, the flag is ignored and the Settings button remains visible. --------- Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Co-authored-by: Reece Browne <74901996+reecebrowne@users.noreply.github.com>
This commit is contained in:
@@ -173,6 +173,12 @@ const QuickAccessBar = forwardRef<HTMLDivElement>((_, ref) => {
|
||||
// onClick: () => setActiveButton('activity')
|
||||
//},
|
||||
|
||||
// Determine if settings button should be hidden
|
||||
// Hide when login is disabled AND showSettingsWhenNoLogin is false
|
||||
const shouldHideSettingsButton =
|
||||
config?.enableLogin === false &&
|
||||
config?.showSettingsWhenNoLogin === false;
|
||||
|
||||
const bottomButtons: ButtonConfig[] = [
|
||||
{
|
||||
id: 'help',
|
||||
@@ -185,17 +191,17 @@ const QuickAccessBar = forwardRef<HTMLDivElement>((_, ref) => {
|
||||
// This will be overridden by the wrapper logic
|
||||
},
|
||||
},
|
||||
{
|
||||
...(shouldHideSettingsButton ? [] : [{
|
||||
id: 'config',
|
||||
name: t("quickAccess.settings", "Settings"),
|
||||
icon: <LocalIcon icon="settings-rounded" width="1.25rem" height="1.25rem" />,
|
||||
size: 'md',
|
||||
type: 'modal',
|
||||
size: 'md' as const,
|
||||
type: 'modal' as const,
|
||||
onClick: () => {
|
||||
navigate('/settings/overview');
|
||||
setConfigModalOpen(true);
|
||||
}
|
||||
}
|
||||
} as ButtonConfig])
|
||||
];
|
||||
|
||||
return (
|
||||
|
||||
@@ -23,6 +23,7 @@ export interface AppConfig {
|
||||
defaultLocale?: string;
|
||||
logoStyle?: 'modern' | 'classic';
|
||||
enableLogin?: boolean;
|
||||
showSettingsWhenNoLogin?: boolean;
|
||||
enableEmailInvites?: boolean;
|
||||
isAdmin?: boolean;
|
||||
enableAlphaFunctionality?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user