forked from Kieran/snort
chore: load only 200 latest posts on profile
This commit is contained in:
parent
6d8416f88e
commit
82d2b19e36
@ -24,6 +24,7 @@ export interface TimelineProps {
|
|||||||
window?: number;
|
window?: number;
|
||||||
relay?: string;
|
relay?: string;
|
||||||
now?: number;
|
now?: number;
|
||||||
|
loadMore?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -137,11 +138,13 @@ const Timeline = (props: TimelineProps) => {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{mainFeed.map(eventElement)}
|
{mainFeed.map(eventElement)}
|
||||||
<LoadMore onLoadMore={feed.loadMore} shouldLoadMore={!feed.loading}>
|
{(props.loadMore === undefined || props.loadMore === true) && (
|
||||||
<Skeleton width="100%" height="120px" margin="0 0 16px 0" />
|
<LoadMore onLoadMore={feed.loadMore} shouldLoadMore={!feed.loading}>
|
||||||
<Skeleton width="100%" height="120px" margin="0 0 16px 0" />
|
<Skeleton width="100%" height="120px" margin="0 0 16px 0" />
|
||||||
<Skeleton width="100%" height="120px" margin="0 0 16px 0" />
|
<Skeleton width="100%" height="120px" margin="0 0 16px 0" />
|
||||||
</LoadMore>
|
<Skeleton width="100%" height="120px" margin="0 0 16px 0" />
|
||||||
|
</LoadMore>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -73,7 +73,7 @@ export default function useTimelineFeed(subject: TimelineSubject, options: Timel
|
|||||||
const rb = createBuilder();
|
const rb = createBuilder();
|
||||||
if (rb) {
|
if (rb) {
|
||||||
if (options.method === "LIMIT_UNTIL") {
|
if (options.method === "LIMIT_UNTIL") {
|
||||||
rb.filter.until(until).limit(10);
|
rb.filter.until(until).limit(200);
|
||||||
} else {
|
} else {
|
||||||
rb.filter.since(since).until(until);
|
rb.filter.since(since).until(until);
|
||||||
if (since === undefined) {
|
if (since === undefined) {
|
||||||
|
@ -252,7 +252,8 @@ export default function ProfilePage() {
|
|||||||
discriminator: id.slice(0, 12),
|
discriminator: id.slice(0, 12),
|
||||||
}}
|
}}
|
||||||
postsOnly={false}
|
postsOnly={false}
|
||||||
method={"TIME_RANGE"}
|
method={"LIMIT_UNTIL"}
|
||||||
|
loadMore={false}
|
||||||
ignoreModeration={true}
|
ignoreModeration={true}
|
||||||
window={60 * 60 * 6}
|
window={60 * 60 * 6}
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user