Commit a7425128 authored by Mygod's avatar Mygod

Fix customRules not saved

parent 8b0c8168
...@@ -50,13 +50,15 @@ class Acl { ...@@ -50,13 +50,15 @@ class Acl {
var customRules: Acl var customRules: Acl
get() { get() {
val acl = Acl() val acl = Acl()
val str = DataStore.publicStore.getString(CUSTOM_RULES) ?: return acl val str = DataStore.publicStore.getString(CUSTOM_RULES)
acl.fromReader(str.reader()) if (str != null) {
if (!acl.bypass) { acl.fromReader(str.reader())
acl.subnets.clear() if (!acl.bypass) {
acl.hostnames.clear() acl.subnets.clear()
acl.bypass = true acl.hostnames.clear()
} acl.bypass = true
}
} else acl.bypass = true
return acl return acl
} }
set(value) = DataStore.publicStore.putString(CUSTOM_RULES, if ((!value.bypass || set(value) = DataStore.publicStore.putString(CUSTOM_RULES, if ((!value.bypass ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment