fix cm client authorized

This commit is contained in:
csf
2022-08-23 15:25:18 +08:00
parent 5326e32128
commit befb6ffe8f
3 changed files with 13 additions and 4 deletions

View File

@@ -465,7 +465,12 @@ class ServerModel with ChangeNotifier {
try {
final client = Client.fromJson(jsonDecode(evt['client']));
parent.target?.dialogManager.dismissByTag(getLoginDialogTag(client.id));
_clients.add(client);
final index = _clients.indexWhere((c) => c.id == client.id);
if (index < 0) {
_clients.add(client);
} else {
_clients[index].authorized = true;
}
DesktopTabBar.onAdd(
tabs,
TabInfo(