mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-07 07:08:03 -05:00
hopefully this really prevents multiple auto syncs even in HMR
This commit is contained in:
@@ -570,11 +570,11 @@ export default {
|
||||
*/
|
||||
autoSyncLoop: function () {
|
||||
// this should not happen in production but sometimes in development with HMR
|
||||
clearTimeout(this.autosync_id)
|
||||
this.autosync_id = undefined
|
||||
clearTimeout(useShoppingListStore().autosync_timeout_id)
|
||||
|
||||
let timeout = Math.max(this.user_preference_store.user_settings.shopping_auto_sync, 1) * 1000 // if disabled (shopping_auto_sync=0) check again after 1 second if enabled
|
||||
this.autosync_id = setTimeout(() => {
|
||||
|
||||
useShoppingListStore().autosync_timeout_id = setTimeout(() => {
|
||||
if (this.user_preference_store.user_settings.shopping_auto_sync > 0) {
|
||||
this.shopping_list_store.autosync()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user