shopping cleanup

This commit is contained in:
vabene1111
2024-12-01 13:16:45 +01:00
parent 423dc7a6bf
commit fa8cd4a2f0
5 changed files with 54 additions and 44 deletions

View File

@@ -34,6 +34,7 @@ export const useShoppingStore = defineStore(_STORE_ID, () => {
// internal
let currentlyUpdating = ref(false)
let initialized = ref(false)
let autoSyncLastTimestamp = ref(new Date('1970-01-01'))
let autoSyncHasFocus = ref(true)
@@ -89,9 +90,10 @@ export const useShoppingStore = defineStore(_STORE_ID, () => {
if (entry.checked) {
categoryStats.countChecked++
} else {
categoryStats.countUnchecked++
if (isDelayed(entry)) {
categoryStats.countUncheckedDelayed++
} else {
categoryStats.countUnchecked++
}
}
})
@@ -175,6 +177,7 @@ export const useShoppingStore = defineStore(_STORE_ID, () => {
entries.value.set(e.id!, e)
})
currentlyUpdating.value = false
initialized.value = true
}).catch((err) => {
currentlyUpdating.value = false
useMessageStore().addError(ErrorMessageType.FETCH_ERROR, err)
@@ -531,6 +534,7 @@ export const useShoppingStore = defineStore(_STORE_ID, () => {
autoSyncHasFocus,
autoSyncLastTimestamp,
currentlyUpdating,
initialized,
getFlatEntries,
hasFailedItems,
itemCheckSyncQueue,