Make network auto control setting reactive with proper GetX observable

Co-authored-by: monkeyWie <[email protected]>
This commit is contained in:
copilot-swe-agent[bot]andmonkeyWie committed 2025-08-11 08:11:00 +00:00
1 parent 14df9490cf
commit 27dc7aea52
2 files changed
+14 -6

No files matched your search

@@ -550,18 +550,16 @@ class SettingView extends GetView<SettingController> {
return null;
}
return ListTile(
return Obx(() => ListTile(
title: Text('networkAutoControl'.tr),
subtitle: Text('networkAutoControlTip'.tr),
trailing: Switch(
value: Database.instance.getNetworkAutoControl(),
value: controller.networkAutoControl.value,
onChanged: (bool value) {
Database.instance.saveNetworkAutoControl(value);
// Trigger rebuild to update the display value
controller.update();
controller.updateNetworkAutoControl(value);
},
),
);
));
}
// advanced config proxy items start