Skip to content

Commit 32edc01

Browse files
committed
remove tw-invisible only if lineType is not null
1 parent a1bbaf8 commit 32edc01

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

web_src/js/features/repo-issue.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,16 @@ export function initRepoIssueCommentDelete() {
188188
const side = conversationHolder.getAttribute('data-side');
189189
const idx = conversationHolder.getAttribute('data-idx');
190190
const lineType = conversationHolder.closest('tr')?.getAttribute('data-line-type');
191-
192-
if (lineType === 'same') {
193-
document.querySelector(`[data-path="${path}"] .add-code-comment[data-idx="${idx}"]`)?.classList.remove('tw-invisible');
194-
} else {
195-
document.querySelector(`[data-path="${path}"] .add-code-comment[data-side="${side}"][data-idx="${idx}"]`)?.classList.remove('tw-invisible');
191+
192+
// the conversation holder could appear either on the "Conversation" page, or the "Files Changed" page
193+
// on the Conversation page, there is no parent "tr", so no need to do anything for "add-code-comment"
194+
if (lineType) {
195+
if (lineType === 'same') {
196+
document.querySelector(`[data-path="${path}"] .add-code-comment[data-idx="${idx}"]`).classList.remove('tw-invisible');
197+
} else {
198+
document.querySelector(`[data-path="${path}"] .add-code-comment[data-side="${side}"][data-idx="${idx}"]`).classList.remove('tw-invisible');
199+
}
196200
}
197-
198201
conversationHolder.remove();
199202
}
200203

0 commit comments

Comments
 (0)