check existence for visibility of addFavAction/addToAb

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-02-24 13:39:28 +08:00
parent 920477bbb2
commit 0ad6bca9ce
2 changed files with 20 additions and 22 deletions

View File

@@ -726,6 +726,10 @@ pub fn main_peer_has_password(id: String) -> bool {
peer_has_password(id)
}
pub fn main_is_in_recent_peers(id: String) -> bool {
PeerConfig::peers().iter().any(|e| e.0 == id)
}
pub fn main_load_recent_peers() {
if !config::APP_DIR.read().unwrap().is_empty() {
let peers: Vec<HashMap<&str, String>> = PeerConfig::peers()