ui
This commit is contained in:
@@ -120,6 +120,9 @@ pub enum PeerEvent {
|
||||
DownloadGameFilesFailed {
|
||||
id: String,
|
||||
},
|
||||
NoPeersHaveGame {
|
||||
id: String,
|
||||
},
|
||||
PeerConnected(SocketAddr),
|
||||
PeerDisconnected(SocketAddr),
|
||||
PeerDiscovered(SocketAddr),
|
||||
@@ -1315,6 +1318,9 @@ async fn handle_get_game_command(ctx: &Ctx, tx_notify_ui: &UnboundedSender<PeerE
|
||||
let peers = { ctx.peer_game_db.read().await.peers_with_game(&id) };
|
||||
if peers.is_empty() {
|
||||
log::warn!("No peers have game {id}");
|
||||
if let Err(e) = tx_notify_ui.send(PeerEvent::NoPeersHaveGame { id: id.clone() }) {
|
||||
log::error!("Failed to send NoPeersHaveGame event: {e}");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user