Merge pull request #1349 from fufesou/flutter_desktop_fix_sciter_lan
flutter_desktop: fix sciter lan peers
This commit is contained in:
		
						commit
						1a0ba50d98
					
				| @ -451,7 +451,7 @@ pub fn main_get_peer(id: String) -> String { | ||||
| } | ||||
| 
 | ||||
| pub fn main_get_lan_peers() -> String { | ||||
|     get_lan_peers() | ||||
|     serde_json::to_string(&get_lan_peers()).unwrap_or_default() | ||||
| } | ||||
| 
 | ||||
| pub fn main_get_connect_status() -> String { | ||||
| @ -592,7 +592,7 @@ pub fn main_load_lan_peers() { | ||||
|     { | ||||
|         let data = HashMap::from([ | ||||
|             ("name", "load_lan_peers".to_owned()), | ||||
|             ("peers", get_lan_peers()), | ||||
|             ("peers", serde_json::to_string(&get_lan_peers()).unwrap_or_default()), | ||||
|         ]); | ||||
|         s.add(serde_json::ser::to_string(&data).unwrap_or("".to_owned())); | ||||
|     }; | ||||
|  | ||||
| @ -500,7 +500,11 @@ impl UI { | ||||
|     } | ||||
| 
 | ||||
|     fn get_lan_peers(&self) -> String { | ||||
|         get_lan_peers() | ||||
|         let peers = get_lan_peers() | ||||
|             .into_iter() | ||||
|             .map(|(id, peer)| (id, peer.username, peer.hostname, peer.platform)) | ||||
|             .collect::<Vec<(String, String, String, String)>>(); | ||||
|         serde_json::to_string(&peers).unwrap_or_default() | ||||
|     } | ||||
| 
 | ||||
|     fn get_uuid(&self) -> String { | ||||
|  | ||||
| @ -584,8 +584,8 @@ pub fn discover() { | ||||
|     }); | ||||
| } | ||||
| 
 | ||||
| pub fn get_lan_peers() -> String { | ||||
|     let peers: Vec<(String, config::PeerInfoSerde)> = config::LanPeers::load() | ||||
| pub fn get_lan_peers() -> Vec<(String, config::PeerInfoSerde)> { | ||||
|     config::LanPeers::load() | ||||
|         .peers | ||||
|         .iter() | ||||
|         .map(|peer| { | ||||
| @ -598,8 +598,7 @@ pub fn get_lan_peers() -> String { | ||||
|                 }, | ||||
|             ) | ||||
|         }) | ||||
|         .collect(); | ||||
|     serde_json::to_string(&peers).unwrap_or_default() | ||||
|         .collect() | ||||
| } | ||||
| 
 | ||||
| pub fn get_uuid() -> String { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user