mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
FEATURE_FLAGS may not be available
This commit is contained in:
parent
40ba03fcfd
commit
f2992a7f3f
@ -95,7 +95,7 @@ export function ExpandableMessage({
|
||||
const statusIconClasses = "h-4 w-4 ml-2 inline";
|
||||
|
||||
if (
|
||||
config?.FEATURE_FLAGS.ENABLE_BILLING &&
|
||||
config?.FEATURE_FLAGS?.ENABLE_BILLING &&
|
||||
config?.APP_MODE === "saas" &&
|
||||
id === I18nKey.STATUS$ERROR_LLM_OUT_OF_CREDITS
|
||||
) {
|
||||
|
||||
@ -28,7 +28,7 @@ export function AccountSettingsContextMenu({
|
||||
|
||||
// Get navigation items and filter out LLM settings if the feature flag is enabled
|
||||
let items = isSaas ? SAAS_NAV_ITEMS : OSS_NAV_ITEMS;
|
||||
if (config?.FEATURE_FLAGS.HIDE_LLM_SETTINGS) {
|
||||
if (config?.FEATURE_FLAGS?.HIDE_LLM_SETTINGS) {
|
||||
items = items.filter((item) => item.to !== "/settings");
|
||||
}
|
||||
|
||||
|
||||
@ -13,6 +13,6 @@ export const useBalance = () => {
|
||||
enabled:
|
||||
!isOnTosPage &&
|
||||
config?.APP_MODE === "saas" &&
|
||||
config?.FEATURE_FLAGS.ENABLE_BILLING,
|
||||
config?.FEATURE_FLAGS?.ENABLE_BILLING,
|
||||
});
|
||||
};
|
||||
|
||||
@ -35,7 +35,7 @@ export const clientLoader = async ({ request }: Route.ClientLoaderArgs) => {
|
||||
}
|
||||
|
||||
// If LLM settings are hidden and user tries to access the LLM settings page
|
||||
if (config?.FEATURE_FLAGS.HIDE_LLM_SETTINGS && pathname === "/settings") {
|
||||
if (config?.FEATURE_FLAGS?.HIDE_LLM_SETTINGS && pathname === "/settings") {
|
||||
// Redirect to the first available settings page
|
||||
if (isSaas) {
|
||||
return redirect("/settings/user");
|
||||
@ -63,12 +63,12 @@ function SettingsScreen() {
|
||||
}
|
||||
|
||||
// Filter out LLM settings if the feature flag is enabled
|
||||
if (config?.FEATURE_FLAGS.HIDE_LLM_SETTINGS) {
|
||||
if (config?.FEATURE_FLAGS?.HIDE_LLM_SETTINGS) {
|
||||
return items.filter((item) => item.to !== "/settings");
|
||||
}
|
||||
|
||||
return items;
|
||||
}, [isSaas, config?.FEATURE_FLAGS.HIDE_LLM_SETTINGS]);
|
||||
}, [isSaas, config?.FEATURE_FLAGS?.HIDE_LLM_SETTINGS]);
|
||||
|
||||
// Current section title for the main content area
|
||||
const currentSectionTitle = useMemo(() => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user