Fix enable/disable Update notification settings.

This commit is contained in:
gerlofvanek
2025-10-21 08:56:47 +02:00
parent 95da26211b
commit 7755b4c505
3 changed files with 22 additions and 2 deletions

View File

@@ -11269,6 +11269,16 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp):
settings_copy["notifications_outgoing_transactions"] = new_value
settings_changed = True
if "notifications_swap_completed" in data:
new_value = data["notifications_swap_completed"]
ensure(
isinstance(new_value, bool),
"New notifications_swap_completed value not boolean",
)
if settings_copy.get("notifications_swap_completed", True) != new_value:
settings_copy["notifications_swap_completed"] = new_value
settings_changed = True
if "notifications_duration" in data:
new_value = data["notifications_duration"]
ensure(
@@ -11283,6 +11293,15 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp):
settings_copy["notifications_duration"] = new_value
settings_changed = True
if "check_updates" in data:
new_value = data["check_updates"]
ensure(
isinstance(new_value, bool), "New check_updates value not boolean"
)
if settings_copy.get("check_updates", True) != new_value:
settings_copy["check_updates"] = new_value
settings_changed = True
if settings_changed:
settings_path = os.path.join(self.data_dir, cfg.CONFIG_FILENAME)
settings_path_new = settings_path + ".new"