default shared password (#12868)

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages
2025-09-07 16:47:35 +08:00
committed by GitHub
parent 9fb4862a45
commit 5c9b4abab2
3 changed files with 34 additions and 3 deletions

View File

@@ -248,15 +248,17 @@ class AbProfile {
String name;
String owner;
String? note;
dynamic info;
int rule;
AbProfile(this.guid, this.name, this.owner, this.note, this.rule);
AbProfile(this.guid, this.name, this.owner, this.note, this.rule, this.info);
AbProfile.fromJson(Map<String, dynamic> json)
: guid = json['guid'] ?? '',
name = json['name'] ?? '',
owner = json['owner'] ?? '',
note = json['note'] ?? '',
info = json['info'],
rule = json['rule'] ?? 0;
}

View File

@@ -1491,6 +1491,13 @@ void connectInPeerTab(BuildContext context, Peer peer, PeerTabIndex tab,
password = peer.password;
isSharedPassword = true;
}
if (password.isEmpty) {
final abPassword = gFFI.abModel.getdefaultSharedPassword();
if (abPassword != null) {
password = abPassword;
isSharedPassword = true;
}
}
}
}
connect(context, peer.id,