fix: for several Shopping List bugs (#1912)

* prevent list refresh while re-ordering items

* update position of new items to stay at the bottom

* prevent refresh while loading

* copy item while editing so it isn't refreshed

* added loading count to handle overlapping actions

* fixed recipe reference throttling

* prevent merging checked and unchecked items
This commit is contained in:
Michael Genson
2023-01-08 11:23:24 -06:00
committed by GitHub
parent 7d94209f3e
commit 856a009dd8
3 changed files with 72 additions and 44 deletions

View File

@@ -28,6 +28,10 @@ class ShoppingListService:
can_merge checks if the two items can be merged together.
"""
# Check if items are both checked or both unchecked
if item1.checked != item2.checked:
return False
# Check if foods are equal
foods_is_none = item1.food_id is None and item2.food_id is None
foods_not_none = not foods_is_none