Fixed the bug with wrong project id in local storage

This commit is contained in:
Vladyslav Matsiiako
2023-01-10 10:55:52 -08:00
parent e7c75b544d
commit a3db20cacf
+6 -1
View File
@@ -212,7 +212,12 @@ export default function Layout({ children }: LayoutProps) {
.split("/") .split("/")
[router.asPath.split("/").length - 1].split("?")[0]; [router.asPath.split("/").length - 1].split("?")[0];
localStorage.setItem("projectData.id", intendedWorkspaceId); if (
!["heroku", "vercel", "github", "netlify"].includes(intendedWorkspaceId)
) {
localStorage.setItem("projectData.id", intendedWorkspaceId);
}
// If a user is not a member of a workspace they are trying to access, just push them to one of theirs // If a user is not a member of a workspace they are trying to access, just push them to one of theirs
if ( if (
!["heroku", "vercel", "github", "netlify"].includes(intendedWorkspaceId) && !["heroku", "vercel", "github", "netlify"].includes(intendedWorkspaceId) &&