mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 12:18:45 -05:00
fixed ability to disabled auto sync
This commit is contained in:
@@ -291,7 +291,10 @@
|
||||
aria-hidden="true"></i
|
||||
></span>
|
||||
</h5>
|
||||
<span class="text-muted" v-if="supermarket.description !== ''">{{ supermarket.description }}</span>
|
||||
<span class="text-muted"
|
||||
v-if="supermarket.description !== ''">{{
|
||||
supermarket.description
|
||||
}}</span>
|
||||
</b-col>
|
||||
</b-row>
|
||||
</b-card-header>
|
||||
@@ -1026,20 +1029,23 @@ export default {
|
||||
"settings.shopping_auto_sync": function (newVal, oldVal) {
|
||||
clearInterval(this.autosync_id)
|
||||
this.autosync_id = undefined
|
||||
if (!newVal) {
|
||||
window.removeEventListener("online", this.updateOnlineStatus)
|
||||
window.removeEventListener("offline", this.updateOnlineStatus)
|
||||
return
|
||||
} else if (oldVal === 0 && newVal > 0) {
|
||||
window.addEventListener("online", this.updateOnlineStatus)
|
||||
window.addEventListener("offline", this.updateOnlineStatus)
|
||||
}
|
||||
this.autosync_id = setInterval(() => {
|
||||
if (this.online && !this.auto_sync_running) {
|
||||
this.auto_sync_running = true
|
||||
this.getShoppingList(true)
|
||||
if (this.settings.shopping_auto_sync > 0) {
|
||||
if (!newVal) {
|
||||
window.removeEventListener("online", this.updateOnlineStatus)
|
||||
window.removeEventListener("offline", this.updateOnlineStatus)
|
||||
return
|
||||
} else if (oldVal === 0 && newVal > 0) {
|
||||
window.addEventListener("online", this.updateOnlineStatus)
|
||||
window.addEventListener("offline", this.updateOnlineStatus)
|
||||
}
|
||||
}, this.settings.shopping_auto_sync * 1000)
|
||||
this.autosync_id = setInterval(() => {
|
||||
if (this.online && !this.auto_sync_running) {
|
||||
this.auto_sync_running = true
|
||||
this.getShoppingList(true)
|
||||
}
|
||||
}, this.settings.shopping_auto_sync * 1000)
|
||||
}
|
||||
|
||||
},
|
||||
"settings.default_delay": function (newVal, oldVal) {
|
||||
this.delay = Number(newVal)
|
||||
@@ -1618,7 +1624,7 @@ export default {
|
||||
|
||||
this.editing_supermarket_categories.forEach((element, index) => {
|
||||
let apiClient = new ApiApiFactory()
|
||||
|
||||
console.log(`relation id ${element.relation_id} order ${element.order} element ${element.order}`)
|
||||
promises.push(apiClient.partialUpdateSupermarketCategoryRelation(element.relation_id, {order: element.order}))
|
||||
})
|
||||
return Promise.all(promises).then(() => {
|
||||
|
||||
Reference in New Issue
Block a user