Skip to content

Commit

Permalink
Remove console.log statements and optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
codad5 committed Nov 29, 2023
1 parent 9077b31 commit 6ed72c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function App() {
const [rateLimit, setRateLimit] = useRecoilState(requestCount);

useEffect(() => {
console.log('platformLatestDataInfo', platformLatestDataInfo);
if (platformLatestDataInfo) return;
const interval = setInterval(() => {
if (platformLatestDataInfo || rateLimit > 5) {
clearInterval(interval);
Expand All @@ -24,14 +24,14 @@ function App() {
setPlatformLatestData(null);
}).finally(() => {
setRateLimit((prev) => prev + 1);
console.log('rateLimit', rateLimit);
})
}, 3000);
if(platformLatestDataInfo || rateLimit > 5) clearInterval(interval);
return () => clearInterval(interval);
}, [platformLatestDataInfo])


useEffect(() => {
if(platformLatestDataInfo) return;
console.log('rateLimit changed', rateLimit);
if (rateLimit <= 5 || platformLatestDataInfo) return;
setPlatformLatestData({
Expand Down

0 comments on commit 6ed72c9

Please sign in to comment.