Middle Search: Fix pagination (#5827)
This commit is contained in:
parent
79949b71c5
commit
7d84defd09
@ -595,6 +595,7 @@ const MiddleSearch: FC<StateProps> = ({
|
||||
ref={containerRef}
|
||||
className={buildClassName(styles.results, 'custom-scroll')}
|
||||
items={viewportResults}
|
||||
itemSelector={`.${RESULT_ITEM_CLASS_NAME}`}
|
||||
preloadBackwards={0}
|
||||
onLoadMore={getMore}
|
||||
onKeyDown={handleKeyDown}
|
||||
|
||||
@ -66,10 +66,12 @@ addActionHandler('performMiddleSearch', async (global, actions, payload): Promis
|
||||
const {
|
||||
results, savedTag, type, isHashtag,
|
||||
} = currentSearch;
|
||||
const offsetId = results?.nextOffsetId;
|
||||
const offsetRate = results?.nextOffsetRate;
|
||||
const offsetPeerId = results?.nextOffsetPeerId;
|
||||
const offsetPeer = offsetPeerId ? selectChat(global, offsetPeerId) : undefined;
|
||||
const shouldReuseParams = results?.query === query;
|
||||
|
||||
const offsetId = shouldReuseParams ? results?.nextOffsetId : undefined;
|
||||
const offsetRate = shouldReuseParams ? results?.nextOffsetRate : undefined;
|
||||
const offsetPeerId = shouldReuseParams ? results?.nextOffsetPeerId : undefined;
|
||||
const offsetPeer = shouldReuseParams && offsetPeerId ? selectChat(global, offsetPeerId) : undefined;
|
||||
|
||||
const shouldHaveQuery = isHashtag || !savedTag;
|
||||
if (shouldHaveQuery && !query) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user