diff --git a/app/static/settings/header_tabs.json b/app/static/settings/header_tabs.json index 31252f4..7a27dc8 100644 --- a/app/static/settings/header_tabs.json +++ b/app/static/settings/header_tabs.json @@ -13,7 +13,7 @@ }, "maps": { "tbm": null, - "href": "https://maps.google.com/maps?q={query}", + "href": "https://maps.google.com/maps?q={map_query}", "name": "Maps", "selected": false }, diff --git a/app/utils/results.py b/app/utils/results.py index b96b1c7..42654e9 100644 --- a/app/utils/results.py +++ b/app/utils/results.py @@ -418,6 +418,10 @@ def get_tabs_content(tabs: dict, Returns: dict: contains the name, the href and if the tab is selected or not """ + map_query = full_query + if '-site:' in full_query: + block_idx = full_query.index('-site:') + map_query = map_query[:block_idx] tabs = copy.deepcopy(tabs) for tab_id, tab_content in tabs.items(): # update name to desired language @@ -433,7 +437,9 @@ def get_tabs_content(tabs: dict, if preferences: query = f"{query}&preferences={preferences}" - tab_content['href'] = tab_content['href'].format(query=query) + tab_content['href'] = tab_content['href'].format( + query=query, + map_query=map_query) # update if selected tab (default all tab is selected) if tab_content['tbm'] == search_type: