Skip to content

Commit

Permalink
fix: fix exec order
Browse files Browse the repository at this point in the history
  • Loading branch information
Enter-tainer committed Sep 28, 2024
1 parent d6c3626 commit aa120bd
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions frontend/lib/dom/comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,14 @@ export const renderComments = async (comments: Comment[]) => {
}

notification.textContent = "";
await openCommentsPanel();
const newSubmitButton = commentsPanel.querySelector(
"[data-review-selected] button[data-action='submit']",
) as HTMLButtonElement;

if (newSubmitButton) {
newSubmitButton.disabled = true;
}

try {
await submitComment({
Expand Down Expand Up @@ -744,14 +752,6 @@ export const renderComments = async (comments: Comment[]) => {
}
}

await openCommentsPanel();
const newSubmitButton = commentsPanel.querySelector(
"[data-review-selected] button[data-action='submit']",
) as HTMLButtonElement;
if (newSubmitButton) {
newSubmitButton.disabled = true;
}

break;
}
case "modify": {
Expand Down Expand Up @@ -803,6 +803,7 @@ export const renderComments = async (comments: Comment[]) => {
case "modify_submit": {
const id = container.dataset.modifingId;
if (id == undefined) return;
await openCommentsPanel();

try {
await _modifyComment({
Expand Down Expand Up @@ -832,7 +833,6 @@ export const renderComments = async (comments: Comment[]) => {
}
}

await openCommentsPanel(); // ??
break;
}
case "delete": {
Expand Down

0 comments on commit aa120bd

Please sign in to comment.