mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-04 20:30:35 +00:00
Added support for general protection legacy mode
This commit is contained in:
parent
20b2f89602
commit
9e400f7efa
5 changed files with 209 additions and 54 deletions
|
@ -366,6 +366,25 @@ class ServersProvider with ChangeNotifier {
|
|||
return result['log'];
|
||||
}
|
||||
|
||||
case 'general_legacy':
|
||||
_protectionsManagementProcess.add('general');
|
||||
notifyListeners();
|
||||
|
||||
final result = await updateGeneralProtectionLegacy(server, newStatus);
|
||||
|
||||
_protectionsManagementProcess = _protectionsManagementProcess.where((e) => e != 'general').toList();
|
||||
|
||||
if (result['result'] == 'success') {
|
||||
_serverStatus.data!.generalEnabled = newStatus;
|
||||
notifyListeners();
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
notifyListeners();
|
||||
return result['log'];
|
||||
}
|
||||
|
||||
|
||||
case 'filtering':
|
||||
_protectionsManagementProcess.add('filtering');
|
||||
notifyListeners();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue