mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-24 04:12:20 +08:00
delete discovery from RustDesk_lan_peers.toml
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
parent
ca991ff39f
commit
920477bbb2
@ -534,7 +534,7 @@ abstract class BasePeerCard extends StatelessWidget {
|
||||
proc: () {
|
||||
() async {
|
||||
if (isLan) {
|
||||
// TODO
|
||||
bind.mainRemoveDiscovered(id: id);
|
||||
} else {
|
||||
final favs = (await bind.mainGetFav()).toList();
|
||||
if (favs.remove(id)) {
|
||||
@ -859,7 +859,11 @@ class DiscoveredPeerCard extends BasePeerCard {
|
||||
}
|
||||
|
||||
menuItems.add(MenuEntryDivider());
|
||||
menuItems.add(_removeAction(peer.id, () async {}));
|
||||
menuItems.add(
|
||||
_removeAction(peer.id, () async {
|
||||
await bind.mainLoadLanPeers();
|
||||
}, isLan: true),
|
||||
);
|
||||
return menuItems;
|
||||
}
|
||||
|
||||
|
@ -796,6 +796,10 @@ pub fn main_load_lan_peers() {
|
||||
};
|
||||
}
|
||||
|
||||
pub fn main_remove_discovered(id: String) {
|
||||
remove_discovered(id);
|
||||
}
|
||||
|
||||
fn main_broadcast_message(data: &HashMap<&str, &str>) {
|
||||
let apps = vec![
|
||||
flutter::APP_TYPE_DESKTOP_REMOTE,
|
||||
|
@ -413,9 +413,7 @@ impl UI {
|
||||
}
|
||||
|
||||
fn remove_discovered(&mut self, id: String) {
|
||||
let mut peers = config::LanPeers::load().peers;
|
||||
peers.retain(|x| x.id != id);
|
||||
config::LanPeers::store(&peers);
|
||||
remove_discovered(id);
|
||||
}
|
||||
|
||||
fn send_wol(&mut self, id: String) {
|
||||
|
@ -596,6 +596,13 @@ pub fn get_lan_peers() -> Vec<HashMap<&'static str, String>> {
|
||||
.collect()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn remove_discovered(id: String) {
|
||||
let mut peers = config::LanPeers::load().peers;
|
||||
peers.retain(|x| x.id != id);
|
||||
config::LanPeers::store(&peers);
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get_uuid() -> String {
|
||||
base64::encode(hbb_common::get_uuid())
|
||||
|
Loading…
Reference in New Issue
Block a user