From 444c2d3182def1e3f75d7d94a9a42cc77cd5559d Mon Sep 17 00:00:00 2001 From: Natan Keddem Date: Mon, 6 May 2024 18:50:13 -0400 Subject: [PATCH 1/2] fixed removal of keys --- autopve/tabs/settings.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/autopve/tabs/settings.py b/autopve/tabs/settings.py index ee7a576..5593ba7 100644 --- a/autopve/tabs/settings.py +++ b/autopve/tabs/settings.py @@ -70,6 +70,8 @@ class Setting(Tab): def remove_key(key): self._scroll.remove(self._elements[key]["row"]) del self._elements[key] + if key in storage.answer(self.answer)[self.type]: + del storage.answer(self.answer)[self.type][key] def set_key(key, value: str): v: Any = None From 2b6f0e41e6adbb8a27a3654a0093f2fbda483aae Mon Sep 17 00:00:00 2001 From: Natan Keddem Date: Mon, 6 May 2024 18:50:44 -0400 Subject: [PATCH 2/2] fixed removal of restrictions --- autopve/tabs/system.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/autopve/tabs/system.py b/autopve/tabs/system.py index 20728ae..ba876ca 100644 --- a/autopve/tabs/system.py +++ b/autopve/tabs/system.py @@ -48,13 +48,11 @@ class System(Tab): with self.scroll: with ui.row() as row: row.tailwind.width("full").align_items("center").justify_content("between") - with ui.row() as row: - row.tailwind.align_items("center") - self._elements[restriction] = { - "control": el.FInput(value=restriction, read_only=True), - "row": row, - } - self._elements[restriction]["control"].tailwind.width("[420px]") + self._elements[restriction] = { + "control": el.FInput(value=restriction, read_only=True), + "row": row, + } + self._elements[restriction]["control"].tailwind.width("[420px]") ui.button(icon="remove", on_click=lambda _, r=restriction: remove_restriction(r)) if self.type not in storage.answer(self.answer): storage.answer(self.answer)[self.type] = []