createTimeline: fix viewport and dupelication

This commit is contained in:
thislight 2024-10-13 15:52:42 +08:00
parent e3f592554b
commit b34580951f
No known key found for this signature in database
GPG key ID: A50F9451AC56A63E
2 changed files with 78 additions and 155 deletions

View file

@ -21,7 +21,6 @@ const TimelinePanel: Component<{
client: mastodon.rest.Client;
name: "home" | "public";
prefetch?: boolean;
fullRefetch?: number;
openFullScreenToot: (
toot: mastodon.v1.Status,
@ -91,7 +90,7 @@ const TimelinePanel: Component<{
<PullDownToRefresh
linkedElement={scrollLinked()}
loading={snapshot.loading}
onRefresh={() => refetchTimeline("prev")}
onRefresh={() => refetchTimeline("next")}
/>
<div
ref={(e) =>
@ -121,9 +120,8 @@ const TimelinePanel: Component<{
toots={toots}
onBoost={onBoost}
onBookmark={onBookmark}
onReply={
({ status }, element) =>
props.openFullScreenToot(status, element, true)
onReply={({ status }, element) =>
props.openFullScreenToot(status, element, true)
}
client={props.client}
isExpended={(status) => status.id === expandedThreadId()}
@ -173,10 +171,10 @@ const TimelinePanel: Component<{
Retry
</Button>
</Match>
<Match when={typeof props.fullRefetch === "undefined"}>
<Match when={true}>
<Button
variant="contained"
onClick={[refetchTimeline, "next"]}
onClick={[refetchTimeline, "prev"]}
disabled={snapshot.loading}
>
Load More