Skip to content

Commit

Permalink
Renumber local roads before attempting to send to server (#383)
Browse files Browse the repository at this point in the history
* Renumber local roads before attempting to send to server

* lint
  • Loading branch information
georgiashay authored and miriam-rittenberg committed Oct 21, 2020
1 parent a779e68 commit 6cd44f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/Auth.vue
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,6 @@ export default {
},
getUserData: function () {
this.gettingUserData = true;
for (var i = 0; i < this.newRoads.length; i++) {
this.saveRemote(this.newRoads[i]);
}
this.getSecure('/sync/roads/')
.then(function (response) {
if (response.status === 200 && response.data.success) {
Expand All @@ -293,8 +290,11 @@ export default {
}
}).then(function (files) {
this.renumberRoads(files);
for (var i = 0; i < this.newRoads.length; i++) {
this.saveRemote(this.newRoads[i]);
}
const fileKeys = Object.keys(files);
for (var i = 0; i < fileKeys.length; i++) {
for (i = 0; i < fileKeys.length; i++) {
const blankRoad = {
downloaded: moment().format(DATE_FORMAT),
changed: files[fileKeys[i]].changed,
Expand Down

0 comments on commit 6cd44f5

Please sign in to comment.