Fix showing local only toots in "All" (#2265)

* Fix warnings about missing dependency in hooks

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>

* Add `allowLocalOnly` to timelineId

Without this local-only toots will never be loaded.

feedType is checked to be public to not show local-only toots in the "Remote" tab.

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>

---------

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
pull/62/head
Plastikmensch 2023-07-03 07:00:38 +02:00 committed by GitHub
parent ed567c9de6
commit b422b5eebd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -102,7 +102,7 @@ const Firehose = ({ feedType, multiColumn }) => {
break; break;
} }
}, },
[dispatch, onlyMedia, feedType], [dispatch, onlyMedia, allowLocalOnly, feedType],
); );
const handleHeaderClick = useCallback(() => columnRef.current?.scrollTop(), []); const handleHeaderClick = useCallback(() => columnRef.current?.scrollTop(), []);
@ -132,7 +132,7 @@ const Firehose = ({ feedType, multiColumn }) => {
} }
return () => disconnect?.(); return () => disconnect?.();
}, [dispatch, signedIn, feedType, onlyMedia]); }, [dispatch, signedIn, feedType, onlyMedia, allowLocalOnly]);
const prependBanner = feedType === 'community' ? ( const prependBanner = feedType === 'community' ? (
<DismissableBanner id='community_timeline'> <DismissableBanner id='community_timeline'>
@ -193,7 +193,7 @@ const Firehose = ({ feedType, multiColumn }) => {
<StatusListContainer <StatusListContainer
prepend={prependBanner} prepend={prependBanner}
timelineId={`${feedType}${onlyMedia ? ':media' : ''}`} timelineId={`${feedType}${feedType === 'public' && allowLocalOnly ? ':allow_local_only' : ''}${onlyMedia ? ':media' : ''}`}
onLoadMore={handleLoadMore} onLoadMore={handleLoadMore}
trackScroll trackScroll
scrollKey='firehose' scrollKey='firehose'