Skip to content

Commit

Permalink
fix(edit): set lastUpdateTime AFTER doing request
Browse files Browse the repository at this point in the history
  • Loading branch information
Sorikairox committed Nov 16, 2021
1 parent 18a6a5c commit 01e80eb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion front/pages/edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ export default {
// console.log("REFRESH", ack);
// console.log("Fetching the flag size");
lastUpdate = new Date();
const beforeUpdateTime = new Date();
await fetch(`${process.env.apiUrl}/flag/after/${lastUpdate.toISOString()}`, {
method: "GET",
crossDomain: true,
Expand All @@ -645,6 +645,7 @@ export default {
})
.then((response) => response.json())
.then((modifiedPixels) => {
lastUpdate = beforeUpdateTime;
if (modifiedPixels.length > 0) {
for (const modifiedPixel of modifiedPixels) {
const localIndex = indexInFlagToLocalIndexMap[modifiedPixel.indexInFlag];
Expand Down

0 comments on commit 01e80eb

Please sign in to comment.