refactor service start/stop

This commit is contained in:
rustdesk
2023-06-06 21:51:40 +08:00
parent d2bb866e48
commit a5d56fcd3f
3 changed files with 36 additions and 37 deletions

View File

@@ -274,12 +274,7 @@ class _ConnectionPageState extends State<ConnectionPage>
offstage: !svcStopped.value,
child: InkWell(
onTap: () async {
bool checked = !bind.mainIsInstalled() ||
await bind.mainCheckSuperUserPermission();
if (checked) {
bind.mainSetOption(key: "stop-service", value: "");
bind.mainSetOption(key: "access-mode", value: "");
}
await start_service(true);
},
child: Text(translate("Start Service"),
style: TextStyle(