mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-04-24 03:00:09 -04:00
moving AbortController to make Vercel happy 🚑
This commit is contained in:
@@ -89,7 +89,7 @@
|
||||
"typescript": "4.5.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"bottleneck": "^2.19.5",
|
||||
"bottleneck": "2.19.5",
|
||||
"node-fetch": "3.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user