Skip to content

Commit

Permalink
fix: bugs related to context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
bugwheels94 committed Jan 12, 2024
1 parent 2152c1c commit aa99041
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 79 deletions.
7 changes: 7 additions & 0 deletions src/routes/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ export const addProjectRoutes = (router: Router) => {
const id = Number(req.params.id);
closeProject(id);
await ProjectRepository.delete(id);
res
.group('global')
.status(200)
.send(id, {
url: '/projects/' + id + '/running-status',
method: 'delete',
});
res.group('global').status(200).send(id);
});
router.get('/projects/:id', async (req, res) => {
Expand Down
9 changes: 4 additions & 5 deletions ui/src/pages/MyTerminal/MyTerminal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,13 @@ export const MyTerminal = ({
useEffect(() => {
if (!state?.winbox) return;
const temp = () => {
contextMenuContext?.addItems(data2);
contextMenuContext.addItems(data2, 'child');
};
state.winbox.body?.addEventListener('contextmenu', temp);
state.winbox.body?.addEventListener('contextmenu', temp, true);
return () => {
state.winbox.body?.removeEventListener('contextmenu', temp);
state.winbox.body?.removeEventListener('contextmenu', temp, true);
};
}, [data2, state?.winbox, contextMenuContext]);
}, [data2, state?.winbox]);

useEffect(() => {
if (!state) return;
Expand Down Expand Up @@ -422,7 +422,6 @@ export const MyTerminal = ({
});
}, [searchValue, state]);
if (!state) return null;
console.log(error);
return (
<>
<Drawer open={!!executionScript} onClose={() => setExecutionScript(null)}>
Expand Down
Loading

0 comments on commit aa99041

Please sign in to comment.