Compare commits

...
Author SHA1 Message Date
LudyandGitHub 56aa163e02 Merge branch 'main' into fix_showSettingsWhenNoLogin_20260625 2026-07-09 23:12:57 +02:00
LudyandGitHub f8ad5c73b9 Merge branch 'main' into fix_showSettingsWhenNoLogin_20260625 2026-07-09 11:05:54 +02:00
LudyandGitHub f19d3cba76 Merge branch 'main' into fix_showSettingsWhenNoLogin_20260625 2026-07-07 23:11:24 +02:00
LudyandGitHub d412bcd14c Merge branch 'main' into fix_showSettingsWhenNoLogin_20260625 2026-07-04 14:26:08 +02:00
Ludy87 9061a44ffb Honor showSettingsWhenNoLogin in config nav
Propagate a showSettingsWhenNoLogin flag through useConfigNavSections and the AppConfigModal caller. AppConfigModal now passes config?.showSettingsWhenNoLogin ?? true into the hook. The desktop, core, and proprietary implementations accept and forward the new parameter. In the proprietary config, the admin sections are only added when the user is admin or when login is disabled AND showSettingsWhenNoLogin is true (preserving historical default behavior by defaulting the flag to true). This allows toggling the historical read-only admin preview when login is turned off.
2026-06-25 14:53:26 +02:00
4 changed files with 9 additions and 2 deletions
@@ -216,6 +216,7 @@ const AppConfigModalInner: React.FC<AppConfigModalProps> = ({
runningEE,
loginEnabled,
handleCloseSync,
config?.showSettingsWhenNoLogin ?? true,
);
const configNavSections = useMemo(
() =>
@@ -32,6 +32,7 @@ export const useConfigNavSections = (
_runningEE: boolean = false,
_loginEnabled: boolean = false,
onRequestClose: () => void = () => {},
_showSettingsWhenNoLogin: boolean = true,
): ConfigNavSection[] => {
const { t } = useTranslation();
@@ -23,6 +23,7 @@ export const useConfigNavSections = (
runningEE: boolean = false,
loginEnabled: boolean = false,
onRequestClose: () => void = () => {},
showSettingsWhenNoLogin: boolean = true,
): ConfigNavSection[] => {
const { t } = useTranslation();
@@ -53,6 +54,7 @@ export const useConfigNavSections = (
runningEE,
loginEnabled,
onRequestClose,
showSettingsWhenNoLogin,
);
const connectionModeSection: ConfigNavSection = {
@@ -32,6 +32,7 @@ export const useConfigNavSections = (
runningEE: boolean = false,
loginEnabled: boolean = false,
onRequestClose: () => void = () => {},
showSettingsWhenNoLogin: boolean = true,
): ConfigNavSection[] => {
const { t } = useTranslation();
@@ -41,6 +42,7 @@ export const useConfigNavSections = (
runningEE,
loginEnabled,
onRequestClose,
showSettingsWhenNoLogin,
);
// Add account management under Preferences
@@ -64,8 +66,9 @@ export const useConfigNavSections = (
}
}
// Add Admin sections if user is admin OR if login is disabled (but mark as disabled)
if (isAdmin || !loginEnabled) {
// Add Admin sections for admins. When login is disabled, keep the historical
// read-only admin preview only if system.showSettingsWhenNoLogin allows it.
if (isAdmin || (!loginEnabled && showSettingsWhenNoLogin)) {
const requiresLogin = !loginEnabled;
const enableLoginTooltip = t(
"settings.tooltips.enableLoginFirst",