Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Fix: Prevent LLM settings from being accessible in SaaS mode via double-click (#9831)

mamoodi6e91d19f8075
diff --git a/frontend/src/components/shared/buttons/settings-button.tsx b/frontend/src/components/shared/buttons/settings-button.tsx
index 68a8d38fa6..9281c38790 100644
--- a/frontend/src/components/shared/buttons/settings-button.tsx
+++ b/frontend/src/components/shared/buttons/settings-button.tsx
@@ -2,6 +2,7 @@ import { useTranslation } from "react-i18next";
import SettingsIcon from "#/icons/settings.svg?react";
import { TooltipButton } from "./tooltip-button";
import { I18nKey } from "#/i18n/declaration";
+import { useConfig } from "#/hooks/query/use-config";
interface SettingsButtonProps {
onClick?: () => void;
@@ -13,6 +14,12 @@ export function SettingsButton({
disabled = false,
}: SettingsButtonProps) {
const { t } = useTranslation();
+ const { data: config } = useConfig();
+
+ // Determine the correct settings path based on app mode
+ // In SaaS mode, navigate directly to user settings to avoid the LLM settings page
+ const settingsPath =
+ config?.APP_MODE === "saas" ? "/settings/user" : "/settings";
return (
<TooltipButton
@@ -20,7 +27,7 @@ export function SettingsButton({
tooltip={t(I18nKey.SETTINGS$TITLE)}
ariaLabel={t(I18nKey.SETTINGS$TITLE)}
onClick={onClick}
- navLinkTo="/settings"
+ navLinkTo={settingsPath}
disabled={disabled}
>
<SettingsIcon width={28} height={28} />