Fix/apollo client spamming infinite requets on failure (#450)
* Remove abort controller by default from requests Apollo client is, for whatever reason, considering it a new hook call when passing an abort controller to be passed to the actual request. On request failures this then causes infinite requests due to it being a new hook call. * Move side effect into useEffect This was missed and started causing issues after the changes of 60429d9d98544e1e49a112aacf77bdbb831740ec. Due to the changes, the component did not re-render unnecessarily which caused the component not to re-render with the fetched data * Reset fetching initial pages state The state was never reset, thus, in case of an error, the initial pages fetch was never triggered again
This commit is contained in:
@@ -108,7 +108,6 @@ export const Updates: React.FC = () => {
|
||||
} = requestManager.useGetRecentlyUpdatedChapters(undefined, {
|
||||
fetchPolicy: 'cache-and-network',
|
||||
notifyOnNetworkStatusChange: true,
|
||||
omitAbortSignal: true,
|
||||
});
|
||||
const hasNextPage = !!chapterUpdateData?.chapters.pageInfo.hasNextPage;
|
||||
const endCursor = chapterUpdateData?.chapters.pageInfo.endCursor;
|
||||
|
||||
Reference in New Issue
Block a user