From fa3c98e5008263cc2c6061b52960d1c0f9bf2854 Mon Sep 17 00:00:00 2001 From: AntonioABLima Date: Mon, 13 Oct 2025 16:18:51 -0300 Subject: [PATCH 1/3] fix: replace history-based navigation (-1 as To) with dynamic URL using window.location.origin in SettingsPage - Replace backTo={-1 as To} with window.location.origin - Previously, if the user opened the Settings page directly and clicked Back, they would be redirected to the browser's default page (e.g., home page or previous site). - Now, they will always be redirected to the Langflow home page. - This ensures that the Back button works correctly across different environments (development, staging, production). - Maintains the same functionality while making navigation environment-independent. --- src/frontend/src/pages/SettingsPage/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/pages/SettingsPage/index.tsx b/src/frontend/src/pages/SettingsPage/index.tsx index 85666d38814b..28b2f2d1206f 100644 --- a/src/frontend/src/pages/SettingsPage/index.tsx +++ b/src/frontend/src/pages/SettingsPage/index.tsx @@ -15,6 +15,8 @@ export default function SettingsPage(): JSX.Element { const autoLogin = useAuthStore((state) => state.autoLogin); const hasStore = useStoreStore((state) => state.hasStore); + const flowsUrl = `${window.location.origin}/flows`; + // Hides the General settings if there is nothing to show const showGeneralSettings = ENABLE_PROFILE_ICONS || hasStore || !autoLogin; @@ -89,7 +91,7 @@ export default function SettingsPage(): JSX.Element { return ( From 98e2d03a44256876112a69475eca5763ceb1f53d Mon Sep 17 00:00:00 2001 From: AntonioABLima Date: Mon, 13 Oct 2025 17:44:31 -0300 Subject: [PATCH 2/3] refactor: remove unnecessary import --- src/frontend/src/pages/SettingsPage/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/pages/SettingsPage/index.tsx b/src/frontend/src/pages/SettingsPage/index.tsx index 28b2f2d1206f..952c363ee510 100644 --- a/src/frontend/src/pages/SettingsPage/index.tsx +++ b/src/frontend/src/pages/SettingsPage/index.tsx @@ -1,4 +1,4 @@ -import { Outlet, type To } from "react-router-dom"; +import { Outlet } from "react-router-dom"; import SideBarButtonsComponent from "@/components/core/sidebarComponent"; import { SidebarProvider } from "@/components/ui/sidebar"; import { CustomStoreSidebar } from "@/customization/components/custom-store-sidebar"; From 3c44775568bcfab8ea1c45098c9bc1562922741f Mon Sep 17 00:00:00 2001 From: AntonioABLima Date: Mon, 13 Oct 2025 17:45:28 -0300 Subject: [PATCH 3/3] refactor: replace window.location.origin with globalThis.window.origin --- src/frontend/src/pages/SettingsPage/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/pages/SettingsPage/index.tsx b/src/frontend/src/pages/SettingsPage/index.tsx index 952c363ee510..d5339bd11a17 100644 --- a/src/frontend/src/pages/SettingsPage/index.tsx +++ b/src/frontend/src/pages/SettingsPage/index.tsx @@ -15,7 +15,7 @@ export default function SettingsPage(): JSX.Element { const autoLogin = useAuthStore((state) => state.autoLogin); const hasStore = useStoreStore((state) => state.hasStore); - const flowsUrl = `${window.location.origin}/flows`; + const flowsUrl = `${globalThis.location.origin}/flows`; // Hides the General settings if there is nothing to show const showGeneralSettings = ENABLE_PROFILE_ICONS || hasStore || !autoLogin;