@@ -139,18 +139,18 @@ class Geography extends Component {
139
139
}
140
140
141
141
checkIfLargeFile ( category , items ) {
142
- const leisSelected = this . state && this . state . leis . length
142
+ const leisSelected = this . state && this . state . leis . length
143
143
const leisFetched = this . state && ! this . state . leiDetails . loading
144
144
145
145
if ( category === 'leis' ) {
146
- if ( items . length && leisFetched )
146
+ if ( items . length && leisFetched )
147
147
return this . checkIfLargeCount ( items , this . state . leiDetails . counts )
148
-
149
- if ( ! items . length )
148
+
149
+ if ( ! items . length )
150
150
return this . checkIfLargeFile ( this . state . category , this . state . items )
151
151
}
152
-
153
- if ( leisSelected && leisFetched )
152
+
153
+ if ( leisSelected && leisFetched )
154
154
return this . checkIfLargeCount ( this . state . leis , this . state . leiDetails . counts )
155
155
156
156
if ( isNationwide ( category ) ) return true
@@ -187,11 +187,11 @@ class Geography extends Component {
187
187
188
188
onInstitutionChange ( selectedLEIs = [ ] ) {
189
189
let leis = selectedLEIs . map ( l => l . value )
190
- if ( leis . includes ( 'all' ) ) leis = [ ]
190
+ if ( leis . indexOf ( 'all' ) !== - 1 ) leis = [ ]
191
191
192
192
return this . setState ( { leis, details : { } } , ( ) => {
193
- return this . setStateAndRoute ( {
194
- isLargeFile : this . checkIfLargeFile ( 'leis' , this . state . leis )
193
+ return this . setStateAndRoute ( {
194
+ isLargeFile : this . checkIfLargeFile ( 'leis' , this . state . leis )
195
195
} )
196
196
} )
197
197
}
@@ -229,7 +229,7 @@ class Geography extends Component {
229
229
}
230
230
231
231
if ( ! newState . variables [ variable ] [ subvar . id ] ) delete newState . variables [ variable ] [ subvar . id ]
232
-
232
+
233
233
const largeFile = this . checkIfLargeFile ( this . state . category , this . state . items )
234
234
235
235
this . setStateAndRoute ( {
@@ -262,9 +262,9 @@ class Geography extends Component {
262
262
}
263
263
264
264
render ( ) {
265
- const { category, details, error, isLargeFile, items, leiDetails, leis,
265
+ const { category, details, error, isLargeFile, items, leiDetails, leis,
266
266
loadingDetails, orderedVariables, variables } = this . state
267
-
267
+
268
268
const nationwide = isNationwide ( category )
269
269
const enabled = nationwide || items . length
270
270
const checksExist = someChecksExist ( variables )
@@ -317,7 +317,7 @@ class Geography extends Component {
317
317
{ details . aggregations && ! error
318
318
? this . showAggregations ( details , orderedVariables )
319
319
: null }
320
- < ActionsWarningsErrors
320
+ < ActionsWarningsErrors
321
321
downloadEnabled = { enabled }
322
322
downloadCallback = { checksExist ? this . requestSubsetCSV : this . requestItemCSV }
323
323
showSummaryButton = { ! details . aggregations }
0 commit comments