Merge pull request #1696 from Heap-Hop/address_book

[address books] optimize performance, fix bugs and add mobile tag actions
This commit is contained in:
RustDesk
2022-10-10 20:21:37 +08:00
committed by GitHub
13 changed files with 251 additions and 308 deletions

View File

@@ -523,7 +523,6 @@ Future<bool> loginDialog() async {
close();
}
// 登录dialog
return CustomAlertDialog(
title: Text(translate("Login")),
content: ConstrainedBox(

View File

@@ -761,20 +761,18 @@ class _AccountState extends State<_Account> {
Widget accountAction() {
return _futureBuilder(future: () async {
return await gFFI.userModel.getUserName();
}(), hasData: (data) {
String username = data as String;
return _Button(
username.isEmpty ? 'Login' : 'Logout',
}(), hasData: (_) {
return Obx(() => _Button(
gFFI.userModel.userName.value.isEmpty ? 'Login' : 'Logout',
() => {
username.isEmpty
gFFI.userModel.userName.value.isEmpty
? loginDialog().then((success) {
if (success) {
// refresh frame
setState(() {});
gFFI.abModel.pullAb();
}
})
: gFFI.userModel.logOut()
});
}));
});
}
}