This commit is contained in:
Badr
2025-11-12 22:59:17 +01:00
parent d22a2dd8ab
commit d9c96ec72a
3 changed files with 12 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ pub enum Event {
Resize(u16, u16),
Notification(Notification),
NewPairedDevice(Address),
FailedPairing(Address),
RequestConfirmation(Confirmation),
ConfirmationSubmitted,
RequestEnterPinCode(EnterPinCode),

View File

@@ -140,6 +140,7 @@ async fn pair(app: &mut App, sender: UnboundedSender<Event>) {
NotificationLevel::Error,
sender.clone(),
);
let _ = sender.send(Event::FailedPairing(device.address()));
}
}
});

View File

@@ -113,6 +113,16 @@ async fn main() -> AppResult<()> {
app.focused_block = bluetui::app::FocusedBlock::PairedDevices;
}
Event::FailedPairing(address) => {
if let Some(req) = &app.requests.display_passkey
&& req.device == address
{
app.requests.display_passkey = None;
}
app.focused_block = bluetui::app::FocusedBlock::PairedDevices;
}
Event::Mouse(_) | Event::Resize(_, _) => {}
}
}