Handle source browse when first page is also the last page (#436)
In case the first page was also the last page, there is no next page that can be fetched. On large screens, where the initial pages to fetch are 2, this resulted in an endless loading screen
This commit is contained in:
@@ -955,7 +955,9 @@ export class RequestManager {
|
||||
getVariablesFor(0),
|
||||
);
|
||||
|
||||
const areInitialPagesFetched = cachedResults.length >= initialPages;
|
||||
const areInitialPagesFetched =
|
||||
cachedResults.length >= initialPages ||
|
||||
(!!cachedResults.length && !cachedResults[cachedResults.length - 1].data?.fetchSourceManga.hasNextPage);
|
||||
const isResultForCurrentInput = result?.forInput === JSON.stringify(getVariablesFor(0));
|
||||
const lastPage = cachedPages.size ? Math.max(...cachedPages) : input.page;
|
||||
const nextPage = isResultForCurrentInput ? result.size : lastPage;
|
||||
|
||||
Reference in New Issue
Block a user