File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -185,28 +185,27 @@ const app = createApp({
185
185
} ,
186
186
async resetAndSearch ( ) {
187
187
this . resetAndMarkLoading ( )
188
- await this . _searchBatch ( this . initialTimeout )
188
+ await this . _searchBatch ( this . loading , this . initialTimeout )
189
189
} ,
190
190
async searchMore ( ) {
191
191
if ( this . loading ) {
192
192
return // Already searching
193
193
}
194
194
this . loading = new AbortController ( ) ;
195
195
this . search . page = this . search . page + 1
196
- await this . _searchBatch ( this . moreTimeout )
196
+ await this . _searchBatch ( this . loading , this . moreTimeout )
197
197
} ,
198
198
_resetResults ( ) {
199
199
this . search . page = 0
200
200
this . search . result . hits = [ ]
201
201
this . search . result . hasMoreHits = false
202
202
} ,
203
- async _searchBatch ( timeout ) {
204
- if ( ! this . hasInput ) {
205
- // No input => no search
206
- return
207
- }
208
- const controller = this . loading
203
+ async _searchBatch ( controller , timeout ) {
209
204
try {
205
+ if ( ! this . hasInput ) {
206
+ // No input => no search
207
+ return
208
+ }
210
209
if ( this . hasInputWithTooFewChars ) {
211
210
throw 'Too few characters'
212
211
}
You can’t perform that action at this time.
0 commit comments