Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: prevent folder click on navigation from duplicating path addition

Scott Wilsonabb577e4e948
diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/SecretDashboardPage.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/SecretDashboardPage.tsx
index 16986058e7..d79a107dba 100644
--- a/frontend/src/pages/secret-manager/SecretDashboardPage/SecretDashboardPage.tsx
+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/SecretDashboardPage.tsx
@@ -963,6 +963,7 @@ const Page = () => {
workspaceId={workspaceId}
secretPath={secretPath}
onNavigateToFolder={handleResetFilter}
+ canNavigate={isFetched}
/>
)}
{canReadDynamicSecret && Boolean(dynamicSecrets?.length) && (
diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/FolderListView/FolderListView.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/FolderListView/FolderListView.tsx
index 9b8c9ccaad..852cc2ae91 100644
--- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/FolderListView/FolderListView.tsx
+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/FolderListView/FolderListView.tsx
@@ -1,12 +1,5 @@
import { subject } from "@casl/ability";
-import {
- faClose,
- faEdit,
- faFolder,
- faInfoCircle,
- faPencilSquare,
- faTrash
-} from "@fortawesome/free-solid-svg-icons";
+import { faClose, faEdit, faFolder, faInfoCircle, faPencilSquare, faTrash } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useNavigate, useSearch } from "@tanstack/react-router";
import { twMerge } from "tailwind-merge";
@@ -36,6 +29,7 @@ type Props = {
workspaceId: string;
secretPath?: string;
onNavigateToFolder: (path: string) => void;
+ canNavigate: boolean;
};
export const FolderListView = ({
@@ -43,7 +37,8 @@ export const FolderListView = ({
environment,
workspaceId,
secretPath = "/",
- onNavigateToFolder
+ onNavigateToFolder,
+ canNavigate
}: Props) => {
const { popUp, handlePopUpToggle, handlePopUpOpen, handlePopUpClose } = usePopUp([
"updateFolder",
@@ -190,7 +185,7 @@ export const FolderListView = ({
};
const handleFolderClick = (name: string, isPending?: boolean) => {
- if (isPending) {
+ if (isPending || !canNavigate) {
return;
}
const path = `${secretPathQueryparam === "/" ? "" : secretPathQueryparam}/${name}`;