Navigation Menu

Skip to content

Commit

Permalink
stop saving dashboard until it is loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
mkellsy committed Oct 19, 2020
1 parent 6aba54a commit 4ccba5b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/views/status.vue
Expand Up @@ -57,7 +57,8 @@
data() {
return {
grid: []
grid: [],
loaded: false,
};
},
Expand All @@ -68,6 +69,7 @@
});
} else {
this.grid = await this.api.get("/layout/dashboard");
this.loaded = true;
}
},
Expand All @@ -79,13 +81,15 @@
},
async updateDashboard() {
const data = JSON.parse(JSON.stringify(this.grid));
if (this.loaded) {
const data = JSON.parse(JSON.stringify(this.grid));
for (let i = 0; i < data.length; i++) {
delete data[i].moved;
}
for (let i = 0; i < data.length; i++) {
delete data[i].moved;
}
await this.api.post("/layout/dashboard", data);
await this.api.post("/layout/dashboard", data);
}
}
}
};
Expand Down

0 comments on commit 4ccba5b

Please sign in to comment.