Fix language switch in not-authed window.
This commit is contained in:
		
							parent
							
								
									711fcc2e11
								
							
						
					
					
						commit
						db435aa9b1
					
				
					 2 changed files with 6 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -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());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1 +1 @@
 | 
			
		|||
Subproject commit d6e7aa6f63febb6f7fd6e0a80a469fb86dc17e6e
 | 
			
		||||
Subproject commit 566f3016367da0246fcf3834c483ce48b33d570a
 | 
			
		||||
		Loading…
	
	Add table
		
		Reference in a new issue