Skip to content

Commit

Permalink
fix(edit): do not fetch map after editing pixel
Browse files Browse the repository at this point in the history
  • Loading branch information
Sorikairox committed Nov 14, 2021
1 parent 28cb968 commit c9d5077
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions front/pages/edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -740,11 +740,11 @@ export default {
this.maxCooldownTime = data.retryAfter;
} else {
this.openSuccessEditModal = true;
this.FetchUserPixelAndMap();
this.FetchUserPixelAndMap(false);
}
this.requesting = false;
},
async FetchUserPixelAndMap() {
async FetchUserPixelAndMap(fetchmap = true) {
// console.log("Fetching user pixel");
await fetch(`${process.env.apiUrl}/pixel`, {
method: "GET",
Expand All @@ -757,7 +757,9 @@ export default {
.then((response) => response.json())
.then(async (data) => {
console.debug("User pixel : ", data);
await this.FetchMap();
if (fetchmap) {
await this.FetchMap();
}
const userPixelCoordinates = getCoordinateFromFlagIndex(indexInFlagToLocalIndexMap[data.indexInFlag]);
this.x = userPixelCoordinates.x;
this.y = userPixelCoordinates.y;
Expand Down

0 comments on commit c9d5077

Please sign in to comment.