mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-25 10:44:41 +02:00
Save the default language after logging in.
We suggest an appropriate language in the intro if server has users system language langpack. But if user doesn't switch to it we save the default ("en") language so that he won't be bothered again.
This commit is contained in:
parent
665a1acfd8
commit
b6046d829f
1 changed files with 9 additions and 0 deletions
|
@ -440,6 +440,15 @@ void Widget::Step::finish(const MTPUser &user, QImage photo) {
|
|||
return;
|
||||
}
|
||||
|
||||
// Save the default language if we've suggested some other and user ignored it.
|
||||
auto currentId = Lang::Current().id();
|
||||
auto defaultId = Lang::DefaultLanguageId();
|
||||
auto suggestedId = Lang::CurrentCloudManager().suggestedLanguage();
|
||||
if (currentId.isEmpty() && !suggestedId.isEmpty() && suggestedId != defaultId) {
|
||||
Lang::Current().switchToId(defaultId);
|
||||
Local::writeLangPack();
|
||||
}
|
||||
|
||||
Messenger::Instance().authSessionCreate(user.c_user().vid.v);
|
||||
Local::writeMtpData();
|
||||
App::wnd()->setupMain(&user);
|
||||
|
|
Loading…
Add table
Reference in a new issue