forked from Archives/Athou_commafeed
abort current request if we're changing what we're going to display
This commit is contained in:
@@ -64,7 +64,7 @@ export function FeedEntriesPage(props: FeedEntriesPageProps) {
|
|||||||
|
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: we subscribe to state.timestamp because we want to reload entries even if the props are the same
|
// biome-ignore lint/correctness/useExhaustiveDependencies: we subscribe to state.timestamp because we want to reload entries even if the props are the same
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
dispatch(
|
const promise = dispatch(
|
||||||
loadEntries({
|
loadEntries({
|
||||||
source: {
|
source: {
|
||||||
type: props.sourceType,
|
type: props.sourceType,
|
||||||
@@ -73,6 +73,7 @@ export function FeedEntriesPage(props: FeedEntriesPageProps) {
|
|||||||
clearSearch: true,
|
clearSearch: true,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
return () => promise.abort()
|
||||||
}, [dispatch, props.sourceType, id, location.state?.timestamp])
|
}, [dispatch, props.sourceType, id, location.state?.timestamp])
|
||||||
|
|
||||||
const noSubscriptions = rootCategory && flattenCategoryTree(rootCategory).every(c => c.feeds.length === 0)
|
const noSubscriptions = rootCategory && flattenCategoryTree(rootCategory).every(c => c.feeds.length === 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user