Skip to content

Commit

Permalink
abort current request if we're changing what we're going to display
Browse files Browse the repository at this point in the history
  • Loading branch information
Athou committed Jul 4, 2024
1 parent d4c9bd1 commit ec7e97e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion commafeed-client/src/pages/app/FeedEntriesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
useEffect(() => {
dispatch(
const promise = dispatch(
loadEntries({
source: {
type: props.sourceType,
Expand All @@ -73,6 +73,7 @@ export function FeedEntriesPage(props: FeedEntriesPageProps) {
clearSearch: true,
})
)
return () => promise.abort()
}, [dispatch, props.sourceType, id, location.state?.timestamp])

const noSubscriptions = rootCategory && flattenCategoryTree(rootCategory).every(c => c.feeds.length === 0)
Expand Down

0 comments on commit ec7e97e

Please sign in to comment.