mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-02 15:45:12 +00:00
Simplified confirmed callback for ConfirmBox instances.
This commit is contained in:
@@ -177,7 +177,6 @@ void Controller::showTermsDecline() {
|
||||
}
|
||||
|
||||
void Controller::showTermsDelete() {
|
||||
const auto box = std::make_shared<QPointer<Ui::BoxContent>>();
|
||||
const auto deleteByTerms = [=] {
|
||||
if (const auto session = account().maybeSession()) {
|
||||
session->termsDeleteNow();
|
||||
@@ -185,13 +184,12 @@ void Controller::showTermsDelete() {
|
||||
Ui::hideLayer();
|
||||
}
|
||||
};
|
||||
*box = Ui::show(
|
||||
Ui::show(
|
||||
Box<ConfirmBox>(
|
||||
tr::lng_terms_delete_warning(tr::now),
|
||||
tr::lng_terms_delete_now(tr::now),
|
||||
st::attentionBoxButton,
|
||||
deleteByTerms,
|
||||
[=] { if (*box) (*box)->closeBox(); }),
|
||||
deleteByTerms),
|
||||
Ui::LayerOption::KeepOther);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user