Skip to content

Commit

Permalink
fix: edit modal gets opened on delete
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvincent committed Sep 23, 2023
1 parent f88a7bc commit 476c841
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions apps/desktop-v2/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,13 @@ function Home() {
label: "Edit task",
shortcut: "enter",
cb: (e) => {
e?.preventDefault(); // prevent typing into the task builder
// if modal is open, then don't open another one
// if the alert dialog is open, then don't open another one
if (anyModalOpen) {
return;
}

e?.preventDefault(); // prevent typing into the task builder

if (chosenTaskIndex !== -1) {
setTaskBuilderIsOpen(true);
}
Expand All @@ -229,7 +230,14 @@ function Home() {
},
},
],
[chosenTaskIndex, handleCheckTask, taskBuilderIsOpen, router, tasks]
[
openTaskBuilder,
chosenTaskIndex,
anyModalOpen,
handleCheckTask,
tasks,
router,
]
);

const handleSubmitAreYouSure = () => {
Expand Down

1 comment on commit 476c841

@vercel
Copy link

@vercel vercel bot commented on 476c841 Sep 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.