File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -94,13 +94,15 @@ export function initRepoDiffShowMore() {
9494 type : 'GET' ,
9595 url,
9696 } ) . done ( ( resp ) => {
97- if ( ! resp || resp . html === '' || resp . empty ) {
97+ if ( ! resp ) {
9898 $ ( '#diff-show-more-files, #diff-show-more-files-stats' ) . removeClass ( 'disabled' ) ;
9999 return ;
100100 }
101101 $ ( '#diff-too-many-files-stats' ) . remove ( ) ;
102102 $ ( '#diff-files' ) . append ( $ ( resp ) . find ( '#diff-files li' ) ) ;
103103 $ ( '#diff-incomplete' ) . replaceWith ( $ ( resp ) . find ( '#diff-file-boxes' ) . children ( ) ) ;
104+ } ) . fail ( ( ) => {
105+ $ ( '#diff-show-more-files, #diff-show-more-files-stats' ) . removeClass ( 'disabled' ) ;
104106 } ) ;
105107 } ) ;
106108 $ ( document ) . on ( 'click' , 'a.diff-show-more-button' , ( e ) => {
@@ -118,12 +120,14 @@ export function initRepoDiffShowMore() {
118120 type : 'GET' ,
119121 url,
120122 } ) . done ( ( resp ) => {
121- if ( ! resp || resp . html === '' || resp . empty ) {
123+ if ( ! resp ) {
122124 $target . removeClass ( 'disabled' ) ;
123125 return ;
124126 }
125127
126128 $target . parent ( ) . replaceWith ( $ ( resp ) . find ( '#diff-file-boxes .diff-file-body .file-body' ) . children ( ) ) ;
129+ } ) . fail ( ( ) => {
130+ $target . removeClass ( 'disabled' ) ;
127131 } ) ;
128132 } ) ;
129133}
You can’t perform that action at this time.
0 commit comments