Properly abort source searches on query change
This commit is contained in:
@@ -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
|
// 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`));
|
abortRequest(new Error(`SourceSearchPreview(${id}, ${displayName}): search string changed`));
|
||||||
},
|
},
|
||||||
[searchString],
|
[searchString, abortRequest],
|
||||||
);
|
);
|
||||||
|
|
||||||
if ((!isLoading && !searchString) || emptyQuery) {
|
if ((!isLoading && !searchString) || emptyQuery) {
|
||||||
|
|||||||
@@ -400,7 +400,7 @@ export function SourceMangas() {
|
|||||||
abortRequest(new Error(`SourceMangas(${sourceId}): search string changed`));
|
abortRequest(new Error(`SourceMangas(${sourceId}): search string changed`));
|
||||||
scrollToTop();
|
scrollToTop();
|
||||||
},
|
},
|
||||||
[query],
|
[query, abortRequest],
|
||||||
);
|
);
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user