Profile Gifts: Fix loading more (#5673)
This commit is contained in:
parent
e8744fcec5
commit
6f74540e98
@ -4,6 +4,7 @@ import { getActions, withGlobal } from '../../../global';
|
|||||||
import type { ApiPeer, ApiSavedStarGift } from '../../../api/types';
|
import type { ApiPeer, ApiSavedStarGift } from '../../../api/types';
|
||||||
|
|
||||||
import { selectPeer } from '../../../global/selectors';
|
import { selectPeer } from '../../../global/selectors';
|
||||||
|
import buildClassName from '../../../util/buildClassName';
|
||||||
import { CUSTOM_PEER_HIDDEN } from '../../../util/objects/customPeer';
|
import { CUSTOM_PEER_HIDDEN } from '../../../util/objects/customPeer';
|
||||||
import { formatIntegerCompact } from '../../../util/textFormat';
|
import { formatIntegerCompact } from '../../../util/textFormat';
|
||||||
import { getGiftAttributes, getStickerFromGift, getTotalGiftAvailability } from '../helpers/gifts';
|
import { getGiftAttributes, getStickerFromGift, getTotalGiftAvailability } from '../helpers/gifts';
|
||||||
@ -90,7 +91,11 @@ const SavedGift = ({
|
|||||||
const totalIssued = getTotalGiftAvailability(gift.gift);
|
const totalIssued = getTotalGiftAvailability(gift.gift);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div ref={ref} className={styles.root} onClick={handleClick}>
|
<div
|
||||||
|
ref={ref}
|
||||||
|
className={buildClassName(styles.root, 'scroll-item')}
|
||||||
|
onClick={handleClick}
|
||||||
|
>
|
||||||
{radialPatternBackdrop}
|
{radialPatternBackdrop}
|
||||||
{!radialPatternBackdrop && <Avatar className={styles.avatar} peer={avatarPeer} size="micro" />}
|
{!radialPatternBackdrop && <Avatar className={styles.avatar} peer={avatarPeer} size="micro" />}
|
||||||
<AnimatedIconFromSticker
|
<AnimatedIconFromSticker
|
||||||
|
|||||||
@ -836,6 +836,7 @@ const Profile: FC<OwnProps & StateProps> = ({
|
|||||||
function renderContentWithTransition() {
|
function renderContentWithTransition() {
|
||||||
return (
|
return (
|
||||||
<Transition
|
<Transition
|
||||||
|
className={`${resultType}-list`}
|
||||||
activeKey={contentTransitionKey}
|
activeKey={contentTransitionKey}
|
||||||
name="fade"
|
name="fade"
|
||||||
>
|
>
|
||||||
@ -844,11 +845,16 @@ const Profile: FC<OwnProps & StateProps> = ({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const activeListSelector = `.shared-media-transition > .Transition_slide-active.${resultType}-list`;
|
||||||
|
const itemSelector = !shouldUseTransitionForContent
|
||||||
|
? `${activeListSelector} > .scroll-item`
|
||||||
|
: `${activeListSelector} > .Transition_slide-active > .content > .scroll-item`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<InfiniteScroll
|
<InfiniteScroll
|
||||||
ref={containerRef}
|
ref={containerRef}
|
||||||
className="Profile custom-scroll"
|
className="Profile custom-scroll"
|
||||||
itemSelector={`.shared-media-transition > .Transition_slide-active.${resultType}-list > .scroll-item`}
|
itemSelector={itemSelector}
|
||||||
items={canRenderContent ? viewportIds : undefined}
|
items={canRenderContent ? viewportIds : undefined}
|
||||||
cacheBuster={cacheBuster}
|
cacheBuster={cacheBuster}
|
||||||
sensitiveArea={PROFILE_SENSITIVE_AREA}
|
sensitiveArea={PROFILE_SENSITIVE_AREA}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user