2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Fix possible crashes in toastParent expiring.

This commit is contained in:
John Preston
2022-12-07 13:03:13 +04:00
parent 6f50906952
commit cfddca8f58
8 changed files with 24 additions and 18 deletions

View File

@@ -44,9 +44,10 @@ void SendReport(
Ui::ReportReason reason,
const QString &comment,
std::variant<v::null_t, MessageIdsList, not_null<PhotoData*>> data) {
auto done = [=] {
auto weak = Ui::MakeWeak(toastParent.get());
auto done = crl::guard(toastParent, [=] {
Ui::Toast::Show(toastParent, tr::lng_report_thanks(tr::now));
};
});
v::match(data, [&](v::null_t) {
peer->session().api().request(MTPaccount_ReportPeer(
peer->input,