Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,8 @@ impl App {
if let Some(req) = &self.requests.display_passkey {
req.render(frame, area);
}
} else {
frame.render_widget("No Bluetooth adapters found. This will automatically refresh when any adapter is detected!".red().bold(), self.area(frame));
}
}

Expand Down Expand Up @@ -806,6 +808,13 @@ impl App {
}
} else {
// Add new detected adapters

// Coming from having NO adapters (e.g. having suspended), no adapter is selected.
// This makes it fallback select the FIRST controller.
// TODO: ideally we would remember what controller was selected before...
if self.controllers.is_empty() && self.controller_state.selected().is_none() {
self.controller_state.select_first();
}
Comment on lines +812 to +817
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not super-happy about falling back to first controller. I guess most people only have one bluetooth controller so maybe it doesn't matter.

self.controllers.push(refreshed_controller);
}
}
Expand Down