Skip to content

Commit

Permalink
Add 12 item layout js changes
Browse files Browse the repository at this point in the history
  • Loading branch information
energee committed Dec 15, 2023
1 parent 0d86b16 commit 7b0ca83
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions assets/js/render-beer-persist.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,29 @@ new Vue({
mounted() {
const id = app.dataset.id;
const tab = app.dataset.tab;
this.loadData(id, tab);
setInterval(() => {
this.getWidths();
this.adjustPosition(app);
}, 100);
setInterval(() => {
this.refreshOnUpate();
}, 10000);
setInterval(() => {
this.loadData(id, tab);
console.log('Data updated from Google Sheets');

// Make the mounted method async
(async () => {
// Await the completion of loadData before executing addCounts
await this.loadData(id, tab);
this.addCounts();
console.log("counts")
}, 10000);

// The rest of your setInterval calls remain the same
setInterval(() => {
this.getWidths();
this.adjustPosition(app);
}, 100);

setInterval(() => {
this.refreshOnUpate();
}, 10000);

setInterval(async () => {
await this.loadData(id, tab);
console.log('Data updated from Google Sheets');
this.addCounts();
console.log("Counts updated");
}, 10000);
})();
}
});

0 comments on commit 7b0ca83

Please sign in to comment.