# HG changeset patch # User Goffi # Date 1619120270 -7200 # Node ID 6fdef01f6671b9979e249a9c4a0e143d4e50bdc2 # Parent 2c3bdba880bb298d43b064d6be927d0f43c56bed browser (lists/view): Q&D fix for status change diff -r 2c3bdba880bb -r 6fdef01f6671 libervia/pages/lists/view/_browser/__init__.py --- a/libervia/pages/lists/view/_browser/__init__.py Thu Apr 22 18:24:11 2021 +0200 +++ b/libervia/pages/lists/view/_browser/__init__.py Thu Apr 22 21:37:50 2021 +0200 @@ -88,17 +88,16 @@ f"Can't get item status: {e}", level="error" ) - status = "to_buy" - if status == "to_buy": - item["status"] = "bought" + status = ["to_buy"] + if status == ["to_buy"]: + item["status"] = ["bought"] class_update_method = item_elt.classList.add checked = True - elif status == "bought": - item["status"] = "to_buy" + elif status == ["bought"]: + item["status"] = ["to_buy"] checked = False class_update_method = item_elt.classList.remove else: - print(status) dialog.notification.show( f"unexpected item status: {status!r}", level="error" @@ -109,7 +108,8 @@ await bridge.listSet( pubsub_service, pubsub_node, - {k: [v] for k,v in item.items()}, + # FIXME: value type should be consistent, or we should serialise + {k: (v if isinstance(v, list) else [v]) for k,v in item.items()}, "", item["id"], ""