Merge pull request #5218 from 21pages/fix

opt _OptionCheckBox reaction
This commit is contained in:
RustDesk 2023-08-01 13:25:11 +08:00 committed by GitHub
commit 6fa48b4ada
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1671,13 +1671,11 @@ Widget _OptionCheckBox(BuildContext context, String label, String key,
var ref = value.obs;
onChanged(option) async {
if (option != null) {
ref.value = option;
if (reverse) option = !option;
isServer
? await mainSetBoolOption(key, option)
: await mainSetLocalBoolOption(key, option);
ref.value = isServer
? mainGetBoolOptionSync(key)
: mainGetLocalBoolOptionSync(key);
;
update?.call();
}