Skip to content

Commit

Permalink
POR-1714: properly redirect users to their first project if the proje…
Browse files Browse the repository at this point in the history
…ct they attempt to route to is non-existent (#3648)
  • Loading branch information
jose-fully-ported authored Sep 25, 2023
1 parent 4d806cd commit 8e745c9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dashboard/src/main/home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ const Home: React.FC<Props> = (props) => {
Number(localStorage.getItem("currentProject")) || projectList[0].id;
}

const foundProjectListEntry = projectList.find(
(item: ProjectListType) => item.id === id
);
if (foundProjectListEntry === undefined) {
id = projectList[0].id
}

const project = await api
.getProject("<token>", {}, { id: id })
.then((res) => res.data as ProjectType);
Expand Down

0 comments on commit 8e745c9

Please sign in to comment.