[bookmarks] no need to show PreviewPlus state when description is empty

This commit is contained in:
Arsentiy Milchakov 2019-12-10 17:15:11 +03:00
parent 18c863bb3c
commit 4dc76d415b
2 changed files with 8 additions and 1 deletions

View file

@ -72,6 +72,12 @@ inline std::string GetDefaultStr(LocalizableString const & str)
inline void SetDefaultStr(LocalizableString & localizableStr, std::string const & str)
{
if (str.empty())
{
localizableStr.erase(kDefaultLangCode);
return;
}
localizableStr[kDefaultLangCode] = str;
}

View file

@ -767,7 +767,8 @@ void Framework::FillBookmarkInfo(Bookmark const & bmk, place_page::Info & info)
info.SetBookmarkData(bmk.GetData());
info.SetBookmarkId(bmk.GetId());
info.SetBookmarkCategoryId(bmk.GetGroupId());
auto openingMode = m_routingManager.IsRoutingActive()
auto const description = GetPreferredBookmarkStr(info.GetBookmarkData().m_description);
auto const openingMode = m_routingManager.IsRoutingActive() || description.empty()
? place_page::OpeningMode::Preview
: place_page::OpeningMode::PreviewPlus;
info.SetOpeningMode(openingMode);