Properly abort source searches on query change

This commit is contained in:
schroda
2024-10-06 16:39:13 +02:00
parent e707e7b7da
commit 5aec8282cb
2 changed files with 2 additions and 2 deletions

View File

@@ -137,7 +137,7 @@ const SourceSearchPreview = React.memo(
// immediate second request since it's the same key. instead the "second" request will be the error handling of SWR
abortRequest(new Error(`SourceSearchPreview(${id}, ${displayName}): search string changed`));
},
[searchString],
[searchString, abortRequest],
);
if ((!isLoading && !searchString) || emptyQuery) {

View File

@@ -400,7 +400,7 @@ export function SourceMangas() {
abortRequest(new Error(`SourceMangas(${sourceId}): search string changed`));
scrollToTop();
},
[query],
[query, abortRequest],
);
useLayoutEffect(() => {