Merge pull request #4949 from Infisical/fix/project-navigation

fix: project navigation
This commit is contained in:
Piyush Gupta
2025-11-26 22:26:37 +05:30
committed by GitHub

View File

@@ -8,7 +8,7 @@ import {
faStar as faSolidStar
} from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { Link, linkOptions } from "@tanstack/react-router";
import { Link, linkOptions, useParams } from "@tanstack/react-router";
import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { OrgPermissionCan } from "@app/components/permissions";
@@ -46,7 +46,7 @@ const PROJECT_TYPE_NAME: Record<ProjectType, string> = {
[ProjectType.SecretScanning]: "Secret Scanning"
};
export const ProjectSelect = () => {
const ProjectSelectInner = () => {
const [searchProject, setSearchProject] = useState("");
const { currentProject: currentWorkspace } = useProject();
const { currentOrg } = useOrganization();
@@ -238,3 +238,14 @@ export const ProjectSelect = () => {
</div>
);
};
export const ProjectSelect = () => {
const params = useParams({ strict: false });
// Return null during navigation when projectId is not available
if (!params.projectId) {
return null;
}
return <ProjectSelectInner />;
};