From a3db20cacf09cb9d3b73e63cc1e5c0079355c2d6 Mon Sep 17 00:00:00 2001 From: Vladyslav Matsiiako Date: Tue, 10 Jan 2023 10:55:52 -0800 Subject: [PATCH] Fixed the bug with wrong project id in local storage --- frontend/components/basic/Layout.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/components/basic/Layout.tsx b/frontend/components/basic/Layout.tsx index d539fce3f..de58a90fa 100644 --- a/frontend/components/basic/Layout.tsx +++ b/frontend/components/basic/Layout.tsx @@ -212,7 +212,12 @@ export default function Layout({ children }: LayoutProps) { .split("/") [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 ( !["heroku", "vercel", "github", "netlify"].includes(intendedWorkspaceId) &&