diff --git a/Telegram/SourceFiles/core/application.cpp b/Telegram/SourceFiles/core/application.cpp index f12b4fb00..c88dc5ab5 100644 --- a/Telegram/SourceFiles/core/application.cpp +++ b/Telegram/SourceFiles/core/application.cpp @@ -583,6 +583,10 @@ void Application::lockByPasscode() { void Application::unlockPasscode() { clearPasscodeLock(); + if (!activeAccount().mtp()) { + // We unlocked initial passcode, so we just start mtproto. + activeAccount().startMtp(); + } if (_window) { _window->clearPasscodeLock(); } diff --git a/Telegram/SourceFiles/main/main_account.cpp b/Telegram/SourceFiles/main/main_account.cpp index eac584216..67930a1c4 100644 --- a/Telegram/SourceFiles/main/main_account.cpp +++ b/Telegram/SourceFiles/main/main_account.cpp @@ -368,8 +368,6 @@ void Account::logOut() { })); } else { // We log out because we've forgotten passcode. - // So we just start mtproto from scratch. - startMtp(); loggedOut(); } }