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:
@@ -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>(
|
||||
|
Reference in New Issue
Block a user