fix changeid

This commit is contained in:
rustdesk 2023-06-26 23:27:18 +08:00
parent 0d658963e4
commit 5b093f5f32
2 changed files with 7 additions and 5 deletions

View File

@ -519,9 +519,12 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
}
Widget changeId() {
final serverModel = Provider.of<ServerModel>(context);
return _Button('Change ID', changeIdDialog,
enabled: !locked && serverModel.connectStatus > 0);
return ChangeNotifierProvider.value(
value: gFFI.serverModel,
child: Consumer<ServerModel>(builder: ((context, model, child) {
return _Button('Change ID', changeIdDialog,
enabled: !locked && model.connectStatus > 0);
})));
}
Widget permissions(context) {

View File

@ -25,10 +25,9 @@ class ServerPage extends StatefulWidget implements PageShape {
PopupMenuButton<String>(
icon: const Icon(Icons.more_vert),
itemBuilder: (context) {
final serverModel = Provider.of<ServerModel>(context);
return [
PopupMenuItem(
enabled: serverModel.connectStatus > 0,
enabled: gFFI.serverModel.connectStatus > 0,
padding: const EdgeInsets.symmetric(horizontal: 16.0),
value: "changeID",
child: Text(translate("Change ID")),