diff --git a/src/screens/SearchAll.tsx b/src/screens/SearchAll.tsx index 89e265e666..c2a8fe9101 100644 --- a/src/screens/SearchAll.tsx +++ b/src/screens/SearchAll.tsx @@ -123,6 +123,9 @@ const SourceSearchPreview = React.memo( useEffect( () => () => { + // INFO: + // with strict mode + dev mode the first request will be aborted. due to using SWR there won't be an + // immediate second request since it's the same key. instead the "second" request will be the error handling of SWR abortRequest( new Error(`SourceSearchPreview(${source.id}, ${source.displayName}): search string changed`), ); diff --git a/src/screens/SourceMangas.tsx b/src/screens/SourceMangas.tsx index df7c982205..5b8aa83d2b 100644 --- a/src/screens/SourceMangas.tsx +++ b/src/screens/SourceMangas.tsx @@ -163,9 +163,10 @@ export default function SourceMangas() { const { sourceId } = useParams<{ sourceId: string }>(); const navigate = useNavigate(); - const { state: { contentType: currentLocationContentType = SourceContentType.POPULAR } = {} } = useLocation<{ - contentType: SourceContentType; - }>(); + const { contentType: currentLocationContentType = SourceContentType.POPULAR } = + useLocation<{ + contentType: SourceContentType; + }>().state ?? {}; const { options } = useLibraryOptionsContext(); const [query] = useQueryParam('query', StringParam); @@ -247,6 +248,9 @@ export default function SourceMangas() { return; } + // INFO: + // with strict mode + dev mode the first request will be aborted. due to using SWR there won't be an + // immediate second request since it's the same key. instead the "second" request will be the error handling of SWR abortRequest(new Error(`SourceMangas(${sourceId}): search string changed`)); }, [searchTerm, contentType],