trigger reload manually instead of relying on effects

This commit is contained in:
Athou
2022-08-13 21:57:03 +02:00
parent 4e5fd18eea
commit e803ce13eb
4 changed files with 22 additions and 60 deletions

View File

@@ -36,8 +36,6 @@ export function FeedEntriesPage(props: FeedEntriesPageProps) {
const sourceLabel = useAppSelector(state => state.entries.sourceLabel)
const sourceWebsiteUrl = useAppSelector(state => state.entries.sourceWebsiteUrl)
const hasMore = useAppSelector(state => state.entries.hasMore)
const readType = useAppSelector(state => state.user.settings?.readingMode)
const order = useAppSelector(state => state.user.settings?.readingOrder)
const dispatch = useAppDispatch()
const titleClicked = () => {
@@ -46,14 +44,8 @@ export function FeedEntriesPage(props: FeedEntriesPageProps) {
}
useEffect(() => {
if (!readType || !order) return
dispatch(
loadEntries({
sourceType: props.sourceType,
req: { id, readType, order },
})
)
}, [dispatch, props.sourceType, id, readType, order, location.state])
dispatch(loadEntries({ type: props.sourceType, id }))
}, [dispatch, props.sourceType, id, location.state])
const hideEditButton = props.sourceType === "category" && id === Constants.categoryIds.all