File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -94,13 +94,15 @@ export function initRepoDiffShowMore() {
94
94
type : 'GET' ,
95
95
url,
96
96
} ) . done ( ( resp ) => {
97
- if ( ! resp || resp . html === '' || resp . empty ) {
97
+ if ( ! resp ) {
98
98
$ ( '#diff-show-more-files, #diff-show-more-files-stats' ) . removeClass ( 'disabled' ) ;
99
99
return ;
100
100
}
101
101
$ ( '#diff-too-many-files-stats' ) . remove ( ) ;
102
102
$ ( '#diff-files' ) . append ( $ ( resp ) . find ( '#diff-files li' ) ) ;
103
103
$ ( '#diff-incomplete' ) . replaceWith ( $ ( resp ) . find ( '#diff-file-boxes' ) . children ( ) ) ;
104
+ } ) . fail ( ( ) => {
105
+ $ ( '#diff-show-more-files, #diff-show-more-files-stats' ) . removeClass ( 'disabled' ) ;
104
106
} ) ;
105
107
} ) ;
106
108
$ ( document ) . on ( 'click' , 'a.diff-show-more-button' , ( e ) => {
@@ -118,12 +120,14 @@ export function initRepoDiffShowMore() {
118
120
type : 'GET' ,
119
121
url,
120
122
} ) . done ( ( resp ) => {
121
- if ( ! resp || resp . html === '' || resp . empty ) {
123
+ if ( ! resp ) {
122
124
$target . removeClass ( 'disabled' ) ;
123
125
return ;
124
126
}
125
127
126
128
$target . parent ( ) . replaceWith ( $ ( resp ) . find ( '#diff-file-boxes .diff-file-body .file-body' ) . children ( ) ) ;
129
+ } ) . fail ( ( ) => {
130
+ $target . removeClass ( 'disabled' ) ;
127
131
} ) ;
128
132
} ) ;
129
133
}
You can’t perform that action at this time.
0 commit comments