Skip to content

Commit 7ff04f5

Browse files
authored
Merge pull request #1959 from trillium/resolve-frontend-project-list-bug
fix: Change conditional to show managed projects list in an else block
2 parents 85370ec + 38e57c6 commit 7ff04f5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

client/src/pages/ProjectList.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@ export default function ProjectList({ auth }) {
4040
async function fetchAllProjects() {
4141
let projectData;
4242

43-
if(user?.accessLevel === 'admin' || user?.accessLevel === 'superadmin') {
43+
if (
44+
user?.accessLevel === 'admin' ||
45+
user?.accessLevel === 'superadmin'
46+
) {
4447
projectData = await projectApiService.fetchProjects();
45-
}
46-
47-
// if user is not admin, but is a project manager, only show projects they manage
48-
if ((user?.accessLevel !== 'admin' || user?.accessLevel !== 'superadmin') && user?.managedProjects.length > 0) {
48+
} else if (user?.managedProjects?.length > 0) {
49+
// if user is not admin, but is a project manager, only show projects they manage
4950
projectData = await projectApiService.fetchPMProjects(user.managedProjects);
5051
}
5152

0 commit comments

Comments
 (0)