Fix memo params causing tuner to lose state (#1924)

zio/stable
Paul Frazee 2023-11-15 17:42:15 -08:00 committed by GitHub
parent 952f5033d0
commit 03b20c70e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -92,9 +92,11 @@ export function usePostFeedQuery(
return new FollowingFeedAPI(agent)
}
}, [feedDesc, params, feedTuners, agent])
const disableTuner = !!params?.disableTuner
const tuner = useMemo(
() => (params?.disableTuner ? new NoopFeedTuner() : new FeedTuner()),
[params],
() => (disableTuner ? new NoopFeedTuner() : new FeedTuner()),
[disableTuner],
)
const pollLatest = useCallback(async () => {