claim_search: Don't clear past page results if subsequent pages timeout.
## Issue 4609: If claim search on latter page fails, don't clear out all previous data ## Note This requires an accompanying change in `lbry-redux` to mark `claimSearchResultLastPageReached` during timeout and to not purge past results. ## Change The previous flow was: increment the page, and expect the next render to either be 0 (timeout + purge) or fill in at least 1 new item. Since it is now possible for no results to be returned for the new page (due to timeout + no purging), the code continues to make another query. This commit stops the perpetual querying. ## Test Case: 1. https://lbry.tv/$/discover?t=imherelbry&content=video&order=top&fresh=year 2. Scroll down a few pages until it timeout happens. Past results are gone.
This commit is contained in:
parent
96e28aadf5
commit
dfef97d715
2 changed files with 2 additions and 0 deletions
|
@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
### Fixed
|
||||
|
||||
- Loss of subscriptions on startup ([#4882](https://github.com/lbryio/lbry-desktop/pull/4882))
|
||||
- Fix lost search results when a timeout occurs _community pr!_ ([#4996](https://github.com/lbryio/lbry-desktop/pull/4996))
|
||||
|
||||
## [0.48.2] - [2020-10-16]
|
||||
|
||||
|
|
|
@ -356,6 +356,7 @@ function ClaimListDiscover(props: Props) {
|
|||
claimSearchResult === undefined ||
|
||||
didNavigateForward ||
|
||||
(!loading &&
|
||||
!claimSearchResultLastPageReached &&
|
||||
claimSearchResult &&
|
||||
claimSearchResult.length &&
|
||||
claimSearchResult.length < dynamicPageSize * options.page &&
|
||||
|
|
Loading…
Reference in a new issue