Skip to content

Commit

Permalink
Merge pull request #772 from ynput/771-manage-projects-links-broken
Browse files Browse the repository at this point in the history
Context Menu: Manage project actions are not working
  • Loading branch information
flynput authored Sep 2, 2024
2 parents 9c1edfc + f9b00ea commit 0e39f8a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions src/containers/ProjectMenu/projectMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,13 @@ const ProjectMenu = ({ isOpen, onHide }) => {
{
label: 'Project Settings',
icon: 'settings_applications',
command: () => setTimeout(() => navigate(`/manageProjects/anatomy?project=${projectName}`), 0),
command: () =>
setTimeout(
dispatch((_, getState) =>
navigate(getState)(`/manageProjects/anatomy?project=${projectName}`),
),
0,
),
},
],
)
Expand All @@ -126,9 +132,12 @@ const ProjectMenu = ({ isOpen, onHide }) => {
return userItems
}

const handleEditClick = (e, name) => {
const handleEditClick = (e, projectName) => {
e.stopPropagation()
navigate(`/manageProjects/anatomy?project=${name}`)
setTimeout(
dispatch((_, getState) => navigate(getState)(`/manageProjects/anatomy?project=${projectName}`)),
0,
)
onHide()
}

Expand Down
2 changes: 1 addition & 1 deletion src/containers/projectList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ const ProjectList = ({
command: () => {
closeContextMenu()
//Enqueing navigation to event loop to avoid close context menu race condition
setTimeout(() => navigate(`/manageProjects/anatomy?project=${sel[0]}`), 0)
setTimeout(dispatch((_, getState) => navigate(getState)(`/manageProjects/anatomy?project=${sel[0]}`)), 0)
},
})
}
Expand Down

0 comments on commit 0e39f8a

Please sign in to comment.