diff options
-rw-r--r-- | src/QuickMedia.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 770ef18..147afd9 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -2616,16 +2616,9 @@ namespace QuickMedia { if(associated_data.search_text_updated && associated_data.fetch_status == FetchStatus::NONE && !associated_data.fetching_next_page_running) { associated_data.search_text_empty = associated_data.update_search_text.empty(); std::string update_search_text = associated_data.update_search_text; - tabs[i].body->clear_items(); - if(tabs[i].page->search_is_suggestion(associated_data.search_text_empty) && tabs[i].body) { - if(update_search_text.empty()) - tabs[i].body->card_view = tab_associated_data[selected_tab].card_view; - else - tabs[i].body->card_view = false; - } else { - tabs[i].body->card_view = tab_associated_data[selected_tab].card_view; - } + if(tabs[i].body && (!tabs[i].page->search_is_suggestion(associated_data.search_text_empty) || associated_data.search_suggestion_submitted)) + tabs[i].body->clear_items(); associated_data.search_text_updated = false; associated_data.fetch_status = FetchStatus::LOADING; @@ -2641,6 +2634,15 @@ namespace QuickMedia { } if(associated_data.fetch_status == FetchStatus::LOADING && associated_data.fetch_type == FetchType::SEARCH && associated_data.fetch_future.ready()) { + if(tabs[i].page->search_is_suggestion(associated_data.search_text_empty) && tabs[i].body) { + if(associated_data.update_search_text.empty()) + tabs[i].body->card_view = tab_associated_data[selected_tab].card_view; + else + tabs[i].body->card_view = false; + } else { + tabs[i].body->card_view = tab_associated_data[selected_tab].card_view; + } + if(!associated_data.search_text_updated) { FetchResult fetch_result = associated_data.fetch_future.get(); tabs[i].body->set_items(std::move(fetch_result.body_items)); |