this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Don't reuse var for both timeout and interval

+3 -2
+3 -2
src/components/background-service.jsx
··· 46 46 47 47 useEffect(() => { 48 48 let sub; 49 + let streamTimeout; 49 50 let pollNotifications; 50 51 if (isLoggedIn && visible) { 51 52 const { masto, streaming, instance } = api(); ··· 56 57 let hasStreaming = false; 57 58 // 2. Start streaming 58 59 if (streaming) { 59 - pollNotifications = setTimeout(() => { 60 + streamTimeout = setTimeout(() => { 60 61 (async () => { 61 62 try { 62 63 hasStreaming = true; ··· 94 95 return () => { 95 96 sub?.unsubscribe?.(); 96 97 sub = null; 97 - clearTimeout(pollNotifications); 98 + clearTimeout(streamTimeout); 98 99 clearInterval(pollNotifications); 99 100 }; 100 101 }, [visible, isLoggedIn]);