diff --git a/sphaira/source/ui/menus/themezer.cpp b/sphaira/source/ui/menus/themezer.cpp index 32d1536..7973c1c 100644 --- a/sphaira/source/ui/menus/themezer.cpp +++ b/sphaira/source/ui/menus/themezer.cpp @@ -365,7 +365,13 @@ Menu::Menu() : MenuBase{"Themezer"_i18n} { fs::FsNativeSd().CreateDirectoryRecursively(CACHE_PATH); SetAction(Button::B, Action{"Back"_i18n, [this]{ - SetPop(); + // if search is valid, then we are in search mode, return back to normal. + if (!m_search.empty()) { + m_search.clear(); + InvalidateAllPages(); + } else { + SetPop(); + } }}); this->SetActions( @@ -480,6 +486,8 @@ Menu::Menu() : MenuBase{"Themezer"_i18n} { std::string out; if (R_SUCCEEDED(swkbd::ShowText(out)) && !out.empty()) { m_search = out; + // PackListDownload(); + InvalidateAllPages(); } })); }}), @@ -652,11 +660,9 @@ void Menu::OnFocusGained() { } void Menu::InvalidateAllPages() { - for (auto& e : m_pages) { - e.m_packList.clear(); - e.m_ready = PageLoadState::None; - } - + m_pages.clear(); + m_pages.resize(1); + m_page_index = 0; PackListDownload(); }