From db435aa9b19184691318a503c3a1f977e331e055 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 29 Jun 2020 22:25:20 +0400 Subject: [PATCH] Fix language switch in not-authed window. --- Telegram/SourceFiles/boxes/language_box.cpp | 9 +++++---- Telegram/lib_ui | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/boxes/language_box.cpp b/Telegram/SourceFiles/boxes/language_box.cpp index f90587ffa2..87fe7d432e 100644 --- a/Telegram/SourceFiles/boxes/language_box.cpp +++ b/Telegram/SourceFiles/boxes/language_box.cpp @@ -1100,12 +1100,13 @@ void LanguageBox::prepare() { ) | rpl::start_with_next([=](const Language &language) { // "#custom" is applied each time it's passed to switchToLanguage(). // So we check that the language really has changed. - const auto currentId = Lang::LanguageIdOrDefault( - Lang::Current().id()); - if (language.id != currentId) { + const auto currentId = [] { + return Lang::LanguageIdOrDefault(Lang::Current().id()); + }; + if (language.id != currentId()) { Lang::CurrentCloudManager().switchToLanguage(language); if (inner) { - inner->changeChosen(currentId); + inner->changeChosen(currentId()); } } }, inner->lifetime()); diff --git a/Telegram/lib_ui b/Telegram/lib_ui index d6e7aa6f63..566f301636 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit d6e7aa6f63febb6f7fd6e0a80a469fb86dc17e6e +Subproject commit 566f3016367da0246fcf3834c483ce48b33d570a