TrendTimelinePanel: remove prefetching
All checks were successful
/ depoly (push) Successful in 1m19s
All checks were successful
/ depoly (push) Successful in 1m19s
This commit is contained in:
parent
f914ada22b
commit
f8f07e9015
1 changed files with 2 additions and 24 deletions
|
@ -1,9 +1,7 @@
|
||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
For,
|
For,
|
||||||
onCleanup,
|
|
||||||
createSignal,
|
createSignal,
|
||||||
untrack,
|
|
||||||
Match,
|
Match,
|
||||||
Switch as JsSwitch,
|
Switch as JsSwitch,
|
||||||
ErrorBoundary,
|
ErrorBoundary,
|
||||||
|
@ -18,7 +16,6 @@ import Thread from "./Thread.jsx";
|
||||||
|
|
||||||
const TrendTimelinePanel: Component<{
|
const TrendTimelinePanel: Component<{
|
||||||
client: mastodon.rest.Client;
|
client: mastodon.rest.Client;
|
||||||
prefetch?: boolean;
|
|
||||||
|
|
||||||
openFullScreenToot: (
|
openFullScreenToot: (
|
||||||
toot: mastodon.v1.Status,
|
toot: mastodon.v1.Status,
|
||||||
|
@ -37,13 +34,6 @@ const TrendTimelinePanel: Component<{
|
||||||
);
|
);
|
||||||
const [expandedId, setExpandedId] = createSignal<string>();
|
const [expandedId, setExpandedId] = createSignal<string>();
|
||||||
|
|
||||||
const tlEndObserver = new IntersectionObserver(() => {
|
|
||||||
if (untrack(() => props.prefetch) && !snapshot.loading)
|
|
||||||
refetchTimeline();
|
|
||||||
});
|
|
||||||
|
|
||||||
onCleanup(() => tlEndObserver.disconnect());
|
|
||||||
|
|
||||||
const isExpandedId = createSelector(expandedId);
|
const isExpandedId = createSelector(expandedId);
|
||||||
|
|
||||||
const isExpanded = (st: mastodon.v1.Status) => isExpandedId(st.id);
|
const isExpanded = (st: mastodon.v1.Status) => isExpandedId(st.id);
|
||||||
|
@ -123,7 +113,7 @@ const TrendTimelinePanel: Component<{
|
||||||
toots={item}
|
toots={item}
|
||||||
onBoost={(...args) => onBoost(index(), ...args)}
|
onBoost={(...args) => onBoost(index(), ...args)}
|
||||||
onBookmark={(...args) => onBookmark(index(), ...args)}
|
onBookmark={(...args) => onBookmark(index(), ...args)}
|
||||||
onReply={(client, status) =>
|
onReply={({ status }, element) =>
|
||||||
props.openFullScreenToot(status, element, true)
|
props.openFullScreenToot(status, element, true)
|
||||||
}
|
}
|
||||||
client={props.client}
|
client={props.client}
|
||||||
|
@ -140,8 +130,6 @@ const TrendTimelinePanel: Component<{
|
||||||
}}
|
}}
|
||||||
</For>
|
</For>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ref={(e) => tlEndObserver.observe(e)}></div>
|
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
|
@ -149,7 +137,7 @@ const TrendTimelinePanel: Component<{
|
||||||
"align-items": "center",
|
"align-items": "center",
|
||||||
"justify-content": "center",
|
"justify-content": "center",
|
||||||
"flex-flow": "column",
|
"flex-flow": "column",
|
||||||
gap: "20px"
|
gap: "20px",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<JsSwitch>
|
<JsSwitch>
|
||||||
|
@ -162,16 +150,6 @@ const TrendTimelinePanel: Component<{
|
||||||
>
|
>
|
||||||
Retry
|
Retry
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
</Match>
|
|
||||||
<Match when={true}>
|
|
||||||
<Button
|
|
||||||
variant="contained"
|
|
||||||
onClick={[refetchTimeline, undefined]}
|
|
||||||
disabled={snapshot.loading}
|
|
||||||
>
|
|
||||||
Refresh
|
|
||||||
</Button>
|
|
||||||
</Match>
|
</Match>
|
||||||
</JsSwitch>
|
</JsSwitch>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue