undefined always first

This commit is contained in:
vabene1111 2024-01-20 02:51:23 +08:00
parent 7d74979859
commit 2b9c294c2a
2 changed files with 10 additions and 13 deletions

View File

@ -565,7 +565,6 @@ export default {
this.autosync_id = undefined
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
console.log('setting', this.user_preference_store.user_settings.shopping_auto_sync, 'timeout ', timeout)
this.autosync_id = setTimeout(() => {
if (this.user_preference_store.user_settings.shopping_auto_sync > 0) {
this.shopping_list_store.autosync()

View File

@ -100,12 +100,12 @@ export const useShoppingListStore = defineStore(_STORE_ID, {
this.total_checked_food = total_checked_food
// ordering
if (useUserPreferenceStore().device_settings.shopping_selected_grouping === this.GROUP_CATEGORY && useUserPreferenceStore().device_settings.shopping_selected_supermarket !== null) {
if (this.UNDEFINED_CATEGORY in structure) {
ordered_structure.push(structure[this.UNDEFINED_CATEGORY])
Vue.delete(structure, this.UNDEFINED_CATEGORY)
}
if (this.UNDEFINED_CATEGORY in structure) {
ordered_structure.push(structure[this.UNDEFINED_CATEGORY])
Vue.delete(structure, this.UNDEFINED_CATEGORY)
}
if (useUserPreferenceStore().device_settings.shopping_selected_grouping === this.GROUP_CATEGORY && useUserPreferenceStore().device_settings.shopping_selected_supermarket !== null) {
for (let c of useUserPreferenceStore().device_settings.shopping_selected_supermarket.category_to_supermarket) {
if (c.category.name in structure) {
ordered_structure.push(structure[c.category.name])
@ -130,13 +130,11 @@ export const useShoppingListStore = defineStore(_STORE_ID, {
* @return {[{id: *, translatable_label: string},{id: *, translatable_label: string},{id: *, translatable_label: string}]}
*/
grouping_options: function () {
return [{'id': this.GROUP_CATEGORY, 'translatable_label': 'Category'}, {
'id': this.GROUP_CREATED_BY,
'translatable_label': 'created_by'
}, {
'id': this.GROUP_RECIPE,
'translatable_label': 'Recipe'
}]
return [
{'id': this.GROUP_CATEGORY, 'translatable_label': 'Category'},
{'id': this.GROUP_CREATED_BY, 'translatable_label': 'created_by'},
{'id': this.GROUP_RECIPE, 'translatable_label': 'Recipe'}
]
},
/**
* checks if failed items are contained in the sync queue