bug: load more fix

This commit is contained in:
2023-03-28 16:41:57 +01:00
parent 465c59ea20
commit 2ccf593476
7 changed files with 71 additions and 39 deletions

View File

@ -121,8 +121,8 @@ export default function useTimelineFeed(subject: TimelineSubject, options: Timel
useEffect(() => {
// clear store if changing relays
main.store.clear();
latest.store.clear();
main.clear();
latest.clear();
}, [options.relay]);
const subNext = useMemo(() => {
@ -180,7 +180,7 @@ export default function useTimelineFeed(subject: TimelineSubject, options: Timel
main: main.data,
related: related.data,
latest: latest.data,
loading: main.store.loading,
loading: main.loading(),
loadMore: () => {
if (main.data) {
console.debug("Timeline load more!");
@ -194,8 +194,8 @@ export default function useTimelineFeed(subject: TimelineSubject, options: Timel
},
showLatest: () => {
if (latest.data) {
main.store.add(latest.data);
latest.store.clear();
main.add(latest.data);
latest.clear();
}
},
};