Really go home before starting app from serial (#1762)

This commit is contained in:
E.T 2024-01-12 17:33:41 +01:00 committed by GitHub
parent eaac40df3a
commit 0a8194fa10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -146,7 +146,7 @@ std::vector<AppInfoConsole> NavigationView::fixedAppListFC = {
{"lookingglass", "Looking Glass", RX}};
bool NavigationView::StartAppByName(const char* name) {
pop();
home(false);
if (strcmp(name, "adsbrx") == 0) {
push<ADSBRxView>();
return true;
@ -660,6 +660,14 @@ void NavigationView::pop(bool trigger_update) {
if (on_pop) on_pop();
}
void NavigationView::home(bool trigger_update) {
while (view_stack.size() > 1) {
pop(false);
}
if (trigger_update) update_view();
}
void NavigationView::display_modal(
const std::string& title,
const std::string& message) {

View File

@ -91,6 +91,7 @@ class NavigationView : public View {
View* push_view(std::unique_ptr<View> new_view);
void replace(View* v);
void pop(bool trigger_update = true);
void home(bool trigger_update);
void display_modal(const std::string& title, const std::string& message);
void display_modal(