Skip to content

Commit

Permalink
Add fetching check to timer hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabau committed Nov 13, 2023
1 parent a5fa65f commit 609a16d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/collab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ const MatchRequestPage = () => {
}, [time, isCurUserMatchFetching]);

useEffect(() => {
if (isCurUserMatchFetching) return;
if (!curUserMatchRequest) {
if (intervalRef.current) {
clearInterval(intervalRef.current);
Expand All @@ -201,7 +202,7 @@ const MatchRequestPage = () => {
intervalRef.current = setInterval(() => {
setTime((prev) => prev + 1);
}, 1000);
}, [curUserMatchRequest]);
}, [curUserMatchRequest, isCurUserMatchFetching]);

const {
data: manualRequests = [],
Expand Down

0 comments on commit 609a16d

Please sign in to comment.