Skip to content

Commit

Permalink
Improvements on slow connection
Browse files Browse the repository at this point in the history
  • Loading branch information
lindlof committed Dec 12, 2020
1 parent 26ce7cf commit 739f974
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions web/src/components/GameTicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const GameTicker = (props: React.PropsWithChildren<Props>) => {
update = await Game.tick(client, game);
} catch {}
if (update === undefined) return;
setGame((g: Game.Game): Game.Game | undefined => {
if (!update) return;
setGame((g: Game.Game | undefined): Game.Game | undefined => {
if (g === undefined || !update) return;
return { ...g, ...update };
});
}, 2000);
Expand Down
4 changes: 2 additions & 2 deletions web/src/wallet/useAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const useAccount = (
useEffect(() => {
if (!client) return;
getAccount(client, setAccount);
const interval = setInterval(() => {
getAccount(client, setAccount);
const interval = setInterval(async () => {
await getAccount(client, setAccount);
}, 10000);
return () => clearInterval(interval);
}, [client, refreshOn]);
Expand Down

0 comments on commit 739f974

Please sign in to comment.