summaryrefslogtreecommitdiff
path: root/src/ui/ui_fsm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/ui_fsm.cpp')
-rw-r--r--src/ui/ui_fsm.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/ui/ui_fsm.cpp b/src/ui/ui_fsm.cpp
index c0c06bb0..18e9caf4 100644
--- a/src/ui/ui_fsm.cpp
+++ b/src/ui/ui_fsm.cpp
@@ -241,12 +241,16 @@ void Browse::react(const internal::ShowNowPlaying& ev) {
void Browse::react(const internal::ShowSettingsPage& ev) {
std::shared_ptr<Screen> screen;
+ std::shared_ptr<screens::Bluetooth> bt_screen;
switch (ev.page) {
case internal::ShowSettingsPage::Page::kRoot:
screen.reset(new screens::Settings());
break;
case internal::ShowSettingsPage::Page::kBluetooth:
- screen.reset(new screens::Bluetooth());
+ bt_screen = std::make_shared<screens::Bluetooth>(sServices->bluetooth(),
+ sServices->nvs());
+ screen = bt_screen;
+ bluetooth_screen_ = bt_screen;
break;
case internal::ShowSettingsPage::Page::kHeadphones:
screen.reset(new screens::Headphones(sServices->nvs()));
@@ -315,6 +319,13 @@ void Browse::react(const internal::BackPressed& ev) {
PopScreen();
}
+void Browse::react(const system_fsm::BluetoothDevicesChanged&) {
+ auto bt = bluetooth_screen_.lock();
+ if (bt) {
+ bt->RefreshDevicesList();
+ }
+}
+
static std::shared_ptr<screens::Playing> sPlayingScreen;
void Playing::entry() {