Skip to content

Commit 63e23af

Browse files
committed
Constantly check for updates
1 parent 743eee0 commit 63e23af

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/components/Actions/index.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,18 @@ export function Actions() {
5555
}, []);
5656

5757
useEffect(() => {
58-
(async () => {
59-
setUpdatesAvailable(await checkUpdates());
60-
})();
58+
const checkForUpdates = async () => {
59+
const canUpdate = await checkUpdates();
60+
if (canUpdate) {
61+
setUpdatesAvailable(true);
62+
} else {
63+
setTimeout(() => {
64+
checkForUpdates();
65+
}, 2000);
66+
}
67+
}
68+
69+
checkForUpdates();
6170
}, []);
6271

6372
return (<>

0 commit comments

Comments
 (0)