Skip to content

Commit

Permalink
skip request on start for the first time
Browse files Browse the repository at this point in the history
  • Loading branch information
adbenitez committed Aug 29, 2023
1 parent 6c01898 commit 9106006
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ export async function init() {
});
}

// The first time the bot sends the state so no need to request
if (!localStorage.getItem(lastSyncReqKey)) {
localStorage.setItem(lastSyncReqKey, new Date().toString());
}
api.sync();
setInterval(() => {
api.sync();
Expand Down

0 comments on commit 9106006

Please sign in to comment.