mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-13 19:47:17 +00:00
Merge pull request #5425 from 21pages/ab
fix searching alias doesn't take effect in address book
This commit is contained in:
@@ -212,6 +212,14 @@ class AbModel {
|
||||
it.first.alias = alias;
|
||||
}
|
||||
|
||||
void unrememberPassword(String id) {
|
||||
final it = peers.where((element) => element.id == id);
|
||||
if (it.isEmpty) {
|
||||
return;
|
||||
}
|
||||
it.first.hash = '';
|
||||
}
|
||||
|
||||
Future<bool> pushAb(
|
||||
{bool toastIfFail = true,
|
||||
bool toastIfSucc = true,
|
||||
@@ -508,4 +516,17 @@ class AbModel {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
reSyncToast(Future<bool> future) {
|
||||
if (!shouldSyncAb()) return;
|
||||
Future.delayed(Duration.zero, () async {
|
||||
final succ = await future;
|
||||
if (succ) {
|
||||
await Future.delayed(Duration(seconds: 2)); // success msg
|
||||
BotToast.showText(
|
||||
contentColor: Colors.lightBlue,
|
||||
text: translate('synced_peer_readded_tip'));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,17 +197,18 @@ class ServerModel with ChangeNotifier {
|
||||
_approveMode = approveMode;
|
||||
update = true;
|
||||
}
|
||||
final oldPwdText = _serverPasswd.text;
|
||||
if (_serverPasswd.text != temporaryPassword &&
|
||||
temporaryPassword.isNotEmpty) {
|
||||
_serverPasswd.text = temporaryPassword;
|
||||
}
|
||||
var stopped = option2bool(
|
||||
"stop-service", await bind.mainGetOption(key: "stop-service"));
|
||||
final oldPwdText = _serverPasswd.text;
|
||||
if (stopped ||
|
||||
verificationMethod == kUsePermanentPassword ||
|
||||
_approveMode == 'click') {
|
||||
_serverPasswd.text = '-';
|
||||
} else {
|
||||
if (_serverPasswd.text != temporaryPassword &&
|
||||
temporaryPassword.isNotEmpty) {
|
||||
_serverPasswd.text = temporaryPassword;
|
||||
}
|
||||
}
|
||||
if (oldPwdText != _serverPasswd.text) {
|
||||
update = true;
|
||||
|
||||
Reference in New Issue
Block a user