moving AbortController to make Vercel happy 🚑

This commit is contained in:
W.J. “dysbulic” H
2022-01-25 17:04:02 -05:00
parent f5295c3242
commit ffb9afb2e9
2 changed files with 3 additions and 3 deletions

View File

@@ -89,7 +89,7 @@
"typescript": "4.5.4"
},
"dependencies": {
"bottleneck": "^2.19.5",
"bottleneck": "2.19.5",
"node-fetch": "3.1.0"
}
}

View File

@@ -17,11 +17,11 @@ export const Watch: React.FC = () => {
const [page, setPage] = useState<number>(1);
const [loading, setLoading] = useState<boolean>(true);
const [isFetchingMore, setIsFetchingMore] = useState<boolean>(false);
const abortController = useMemo(() => new AbortController(), []);
const onScreen = useOnScreen(moreRef);
const maxPages = useMemo(() => Math.ceil(count / LIMIT) || 0, [count]);
useEffect(() => {
const abortController = new AbortController();
const load = async () => {
const res = await fetch(URL, {
signal: abortController.signal,
@@ -45,7 +45,7 @@ export const Watch: React.FC = () => {
return () => {
abortController.abort();
};
}, [abortController]);
}, []);
useEffect(() => {
if (!loading && onScreen && page <= maxPages && nextPageToken) {