aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/QuickMedia.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index a00f056..c85f031 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -1750,6 +1750,15 @@ namespace QuickMedia {
auto prev_selected_item = tabs[selected_tab].page->submit_body_item;
tabs[selected_tab].page->submit_body_item = selected_item;
+ if((tabs[selected_tab].page->is_single_page() || (tabs[selected_tab].page->search_is_suggestion() && !search_suggestion_submitted))
+ && tab_associated_data[selected_tab].fetch_future.valid())
+ {
+ tabs[selected_tab].page->cancel_operation();
+ tab_associated_data[selected_tab].fetch_future.cancel();
+ tab_associated_data[selected_tab].fetch_status = FetchStatus::NONE;
+ tab_associated_data[selected_tab].search_text_updated = false;
+ }
+
auto plugin_submit_handler = [&tabs, selected_tab, &selected_item, &search_text, &new_tabs, &new_body_items, search_suggestion_submitted]() {
if(tabs[selected_tab].page->search_is_suggestion() && !search_suggestion_submitted) {
PluginResult plugin_result = tabs[selected_tab].page->submit_suggestion(selected_item ? selected_item->get_title() : search_text, selected_item ? selected_item->url : search_text, new_body_items);