createTimeline: fix viewport and dupelication
This commit is contained in:
parent
e3f592554b
commit
b34580951f
2 changed files with 78 additions and 155 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue