2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Move delete-from-ToS to AuthSession.

This commit is contained in:
John Preston
2019-03-27 12:37:25 +04:00
parent 3fa3428b4b
commit efb2972d28
5 changed files with 16 additions and 10 deletions

View File

@@ -202,12 +202,19 @@ void MainWindow::showTermsDecline() {
void MainWindow::showTermsDelete() {
const auto box = std::make_shared<QPointer<BoxContent>>();
const auto deleteByTerms = [=] {
if (AuthSession::Exists()) {
Auth().termsDeleteNow();
} else {
Ui::hideLayer();
}
};
*box = Ui::show(
Box<ConfirmBox>(
lang(lng_terms_delete_warning),
lang(lng_terms_delete_now),
st::attentionBoxButton,
[=] { Core::App().termsDeleteNow(); },
deleteByTerms,
[=] { if (*box) (*box)->closeBox(); }),
LayerOption::KeepOther);
}