aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-08-24 00:25:18 +0200
committerdec05eba <dec05eba@protonmail.com>2021-08-24 00:25:18 +0200
commit591c78ff6b148ddd3c97ad48dce15ec697456fe5 (patch)
tree948dd612e47ef413382c9c7c819f657a6b88ec89 /src
parentff85dfb6a9b58d6e5a25c614e7aa3e061c6a3e1f (diff)
Fix youtube search not removing search suggestion on enter if submit is done quickly after search
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);