Fix use-items loading state when an existing request gets canceled (#16881)

* prevent canceled requests from clearing loadingTimeout

* rename CancelTokenSource variable

* don't set loading to false if there's still loadingTimeout

* updated request cancellation to use the abort controller

* azri's getItemCount fix

* prevent cancelled requests from throwing errors

* prevent count request from firing twice

* Remove fetchOnInit option

Co-authored-by: Brainslug <tim@brainslug.nl>
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
This commit is contained in:
Azri Kahar
2022-12-23 05:31:43 +08:00
committed by GitHub
parent 602f5db4f7
commit fdeddf0118
2 changed files with 64 additions and 40 deletions

View File

@@ -111,8 +111,7 @@ export default defineLayout<LayoutOptions>({
fields: queryFields,
filter: filterWithCalendarView,
search: search,
},
false
}
);
const events: Ref<EventInput> = computed(