mirror of
https://github.com/Infisical/infisical.git
synced 2026-01-10 07:58:15 -05:00
Merge pull request #4949 from Infisical/fix/project-navigation
fix: project navigation
This commit is contained in:
@@ -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 />;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user