2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Fix destroyed key clearing.

This commit is contained in:
John Preston
2019-11-20 16:33:45 +03:00
parent 4c24ec7725
commit 4edfd4804f
11 changed files with 108 additions and 147 deletions

View File

@@ -378,13 +378,12 @@ void Account::startMtp() {
void Account::logOut() {
if (_loggingOut) {
return;
}
_loggingOut = true;
if (_mtp) {
_mtp->logout(::rpcDone([=] {
loggedOut();
}), ::rpcFail([=] {
loggedOut();
return true;
}));
_mtp->logout([=] { loggedOut(); });
} else {
// We log out because we've forgotten passcode.
loggedOut();
@@ -399,6 +398,7 @@ void Account::forcedLogOut() {
}
void Account::loggedOut() {
_loggingOut = false;
if (Global::LocalPasscode()) {
Global::SetLocalPasscode(false);
Global::RefLocalPasscodeChanged().notify();