mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-06 22:58:19 -05:00
rebase with develop
This commit is contained in:
@@ -734,7 +734,8 @@ export default {
|
|||||||
new_supermarket: { entrymode: false, value: undefined, editmode: undefined },
|
new_supermarket: { entrymode: false, value: undefined, editmode: undefined },
|
||||||
new_category: { entrymode: false, value: undefined },
|
new_category: { entrymode: false, value: undefined },
|
||||||
autosync_id: undefined,
|
autosync_id: undefined,
|
||||||
auto_sync_running: false,
|
auto_sync_running: false, // track to not start a new sync before old one was finished
|
||||||
|
auto_sync_blocked: false, // blocking auto sync while request to check item is still running
|
||||||
show_delay: false,
|
show_delay: false,
|
||||||
drag: false,
|
drag: false,
|
||||||
show_modal: false,
|
show_modal: false,
|
||||||
@@ -905,9 +906,6 @@ export default {
|
|||||||
entry_mode_simple(newVal) {
|
entry_mode_simple(newVal) {
|
||||||
this.$cookies.set(SETTINGS_COOKIE_NAME, newVal)
|
this.$cookies.set(SETTINGS_COOKIE_NAME, newVal)
|
||||||
},
|
},
|
||||||
// "new_recipe.servings": function () {
|
|
||||||
// return
|
|
||||||
// },
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getShoppingList()
|
this.getShoppingList()
|
||||||
@@ -1103,7 +1101,9 @@ export default {
|
|||||||
}
|
}
|
||||||
this.loading = false
|
this.loading = false
|
||||||
} else {
|
} else {
|
||||||
this.mergeShoppingList(results.data)
|
if (!this.auto_sync_blocked) {
|
||||||
|
this.mergeShoppingList(results.data)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
@@ -1226,6 +1226,7 @@ export default {
|
|||||||
},
|
},
|
||||||
updateChecked: function (update) {
|
updateChecked: function (update) {
|
||||||
// when checking a sub item don't refresh the screen until all entries complete but change class to cross out
|
// when checking a sub item don't refresh the screen until all entries complete but change class to cross out
|
||||||
|
this.auto_sync_blocked = true
|
||||||
let promises = []
|
let promises = []
|
||||||
update.entries.forEach((x) => {
|
update.entries.forEach((x) => {
|
||||||
const id = x?.id ?? x
|
const id = x?.id ?? x
|
||||||
@@ -1240,10 +1241,15 @@ export default {
|
|||||||
Vue.set(item, "completed_at", completed_at)
|
Vue.set(item, "completed_at", completed_at)
|
||||||
})
|
})
|
||||||
|
|
||||||
Promise.all(promises).catch((err) => {
|
Promise.all(promises)
|
||||||
console.log(err, err.response)
|
.then(() => {
|
||||||
StandardToasts.makeStandardToast(StandardToasts.FAIL_UPDATE)
|
this.auto_sync_blocked = false
|
||||||
})
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
this.auto_sync_blocked = false
|
||||||
|
console.log(err, err.response)
|
||||||
|
StandardToasts.makeStandardToast(StandardToasts.FAIL_UPDATE)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
updateFood: function (food, field) {
|
updateFood: function (food, field) {
|
||||||
let api = new ApiApiFactory()
|
let api = new ApiApiFactory()
|
||||||
|
|||||||
Reference in New Issue
Block a user