File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ function updateFromProps() {
187
187
}
188
188
189
189
async function inputClick() {
190
- if (props .readonly && ! props .searchDisabled ) return ;
190
+ if (props .readonly || props .searchDisabled ) return ;
191
191
// Toggle local dropdown
192
192
showDropdown .value = ! showDropdown .value ;
193
193
// If the dropdown is about to close, reset the search
@@ -266,7 +266,7 @@ onMounted(() => {
266
266
267
267
const filteredItems = computed (() => {
268
268
269
- if (! props .searchDisabled ) {
269
+ if (props .searchDisabled ) {
270
270
return props .options || [];
271
271
}
272
272
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ import sanitizeHtml from 'sanitize-html'
10
10
import debounce from 'debounce' ;
11
11
12
12
const LS_LANG_KEY = `afLanguage` ;
13
+ const MAX_CONSECUTIVE_EMPTY_RESULTS = 2 ;
14
+ const ITEMS_PER_PAGE_LIMIT = 100 ;
13
15
14
16
export async function callApi ( { path, method, body= undefined } : {
15
17
path : string , method : 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'
@@ -233,7 +235,7 @@ export function handleForeignResourcePagination(
233
235
if ( items . length === 0 ) {
234
236
const newEmptyCount = emptyResultsCount + 1 ;
235
237
return {
236
- hasMore : newEmptyCount < 2 , // Stop loading after 2 consecutive empty results
238
+ hasMore : newEmptyCount < MAX_CONSECUTIVE_EMPTY_RESULTS , // Stop loading after 2 consecutive empty results
237
239
emptyResultsCount : newEmptyCount
238
240
} ;
239
241
} else {
@@ -245,7 +247,7 @@ export function handleForeignResourcePagination(
245
247
}
246
248
} else {
247
249
return {
248
- hasMore : items . length === 100 ,
250
+ hasMore : items . length === ITEMS_PER_PAGE_LIMIT ,
249
251
emptyResultsCount : 0
250
252
} ;
251
253
}
You can’t perform that action at this time.
0 commit comments