File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -445,12 +445,15 @@ export function initRepoPullRequestReview() {
445
445
const groupID = commentDiv . closest ( 'div[id^="code-comments-"]' ) . attr ( 'id' ) ;
446
446
if ( groupID && groupID . startsWith ( 'code-comments-' ) ) {
447
447
const id = groupID . slice ( 14 ) ;
448
- const ancestorDiffHeader = commentDiv . closest ( '.diff-file-box' ) . children ( '.diff-file-header' ) . eq ( 0 ) [ 0 ] ;
448
+ const ancestorDiffBox = commentDiv . closest ( '.diff-file-box' ) ;
449
+ const ancestorDiffHeader = ancestorDiffBox . find ( '.diff-file-header' ) [ 0 ] ;
449
450
$ ( `#show-outdated-${ id } ` ) . addClass ( 'gt-hidden' ) ;
450
451
$ ( `#code-comments-${ id } ` ) . removeClass ( 'gt-hidden' ) ;
451
452
$ ( `#code-preview-${ id } ` ) . removeClass ( 'gt-hidden' ) ;
452
453
$ ( `#hide-outdated-${ id } ` ) . removeClass ( 'gt-hidden' ) ;
453
- setFileFolding ( ancestorDiffHeader . closest ( '.file-content' ) , ancestorDiffHeader . querySelector ( '.fold-file' ) , false ) ;
454
+ if ( ancestorDiffBox . attr ( 'data-folded' ) && ancestorDiffBox . attr ( 'data-folded' ) === "true" ) {
455
+ setFileFolding ( ancestorDiffBox [ 0 ] , ancestorDiffHeader . querySelector ( '.fold-file' ) , false ) ;
456
+ }
454
457
commentDiv [ 0 ] . scrollIntoView ( {
455
458
behavior : 'auto' ,
456
459
block : 'center' ,
You can’t perform that action at this time.
0 commit comments