File tree 1 file changed +10
-7
lines changed
1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -187,14 +187,17 @@ export function initRepoIssueCommentDelete() {
187
187
const path = conversationHolder . getAttribute ( 'data-path' ) ;
188
188
const side = conversationHolder . getAttribute ( 'data-side' ) ;
189
189
const idx = conversationHolder . getAttribute ( 'data-idx' ) ;
190
- 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' ) ;
190
+ const lineType = conversationHolder . closest ( 'tr' ) ?. getAttribute ( 'data-line-type' ) ;
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
+ }
196
200
}
197
-
198
201
conversationHolder . remove ( ) ;
199
202
}
200
203
You can’t perform that action at this time.
0 commit comments