mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
fix: prevent folder click on navigation from duplicating path addition
This commit is contained in:
@@ -963,6 +963,7 @@ const Page = () => {
|
||||
workspaceId={workspaceId}
|
||||
secretPath={secretPath}
|
||||
onNavigateToFolder={handleResetFilter}
|
||||
canNavigate={isFetched}
|
||||
/>
|
||||
)}
|
||||
{canReadDynamicSecret && Boolean(dynamicSecrets?.length) && (
|
||||
|
||||
@@ -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}`;
|
||||
|
||||
Reference in New Issue
Block a user