2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Add upload cancel confirmation on Quit and Log Out.

This commit is contained in:
John Preston
2022-01-26 12:41:27 +03:00
parent 8c349c0515
commit 6a3ad52aef
13 changed files with 195 additions and 48 deletions

View File

@@ -395,19 +395,12 @@ void Controller::showLogoutConfirmation() {
? &sessionController()->session().account()
: nullptr;
const auto weak = base::make_weak(account);
const auto callback = [=] {
if (account && !weak) {
return;
const auto callback = [=](Fn<void()> close) {
if (!account || weak) {
Core::App().logoutWithChecks(account);
}
if (account
&& account->sessionExists()
&& Core::App().exportManager().inProgress(&account->session())) {
Ui::hideLayer();
Core::App().exportManager().stopWithConfirmation([=] {
Core::App().logout(account);
});
} else {
Core::App().logout(account);
if (close) {
close();
}
};
show(Box<Ui::ConfirmBox>(