[ios] fix pasting coords to the search

Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
This commit is contained in:
Kiryl Kaveryn 2025-03-12 12:27:40 +04:00
parent 2d3c5b25a5
commit fd5feb2727
Signed by: kirylkaveryn
SSH key fingerprint: SHA256:P3swI85Rc1ZoE8vyL28Oa6+FgRIaOwsjkKyqcVZ0NtY
2 changed files with 10 additions and 4 deletions

View file

@ -61,7 +61,7 @@ using Observers = NSHashTable<Observer>;
- (void)searchEverywhere {
self.lastSearchTimestamp += 1;
NSUInteger const timestamp = self.lastSearchTimestamp;
search::EverywhereSearchParams params{
m_query, m_locale, {} /* default timeout */, m_isCategory,
// m_onResults
@ -156,6 +156,7 @@ using Observers = NSHashTable<Observer>;
+ (void)showResultAtIndex:(NSUInteger)index {
auto const & result = [MWMSearch manager]->m_everywhereResults[index];
GetFramework().StopLocationFollow();
GetFramework().SelectSearchResult(result, true);
}
@ -168,8 +169,13 @@ using Observers = NSHashTable<Observer>;
+ (void)showEverywhereSearchResultsOnMap {
MWMSearch * manager = [MWMSearch manager];
if (![MWMRouter isRoutingActive])
GetFramework().ShowSearchResults(manager->m_everywhereResults);
if (![MWMRouter isRoutingActive]) {
auto const & results = manager->m_everywhereResults;
if (results.GetCount() == 1)
[self showResultAtIndex:0];
else
GetFramework().ShowSearchResults(manager->m_everywhereResults);
}
}
+ (void)showViewportSearchResultsOnMap {

View file

@ -70,12 +70,12 @@ final class SearchOnMapInteractor: NSObject {
searchManager.saveQuery(searchText.text,
forInputLocale: searchText.locale)
showResultsOnMap = true
searchManager.showEverywhereSearchResultsOnMap()
return .showOnTheMap
}
private func processTypedText(_ searchText: SearchOnMap.SearchText) -> SearchOnMap.Response {
isUpdatesDisabled = false
showResultsOnMap = true
searchManager.searchQuery(searchText.text,
forInputLocale: searchText.locale,
withCategory: false)