diff --git a/Telegram/SourceFiles/boxes/send_credits_box.cpp b/Telegram/SourceFiles/boxes/send_credits_box.cpp index 303560ab3..309f4833c 100644 --- a/Telegram/SourceFiles/boxes/send_credits_box.cpp +++ b/Telegram/SourceFiles/boxes/send_credits_box.cpp @@ -43,7 +43,8 @@ namespace Ui { void SendCreditsBox( not_null box, - std::shared_ptr form) { + std::shared_ptr form, + Fn sent) { if (!form) { return; } @@ -145,6 +146,7 @@ void SendCreditsBox( ).done([=](auto result) { state->confirmButtonBusy = false; box->closeBox(); + sent(); }).fail([=](const MTP::Error &error) { state->confirmButtonBusy = false; box->uiShow()->showToast(error.type()); diff --git a/Telegram/SourceFiles/boxes/send_credits_box.h b/Telegram/SourceFiles/boxes/send_credits_box.h index bbc74107a..25ceb1d56 100644 --- a/Telegram/SourceFiles/boxes/send_credits_box.h +++ b/Telegram/SourceFiles/boxes/send_credits_box.h @@ -19,6 +19,7 @@ class GenericBox; void SendCreditsBox( not_null box, - std::shared_ptr data); + std::shared_ptr data, + Fn sent); } // namespace Ui diff --git a/Telegram/SourceFiles/payments/payments_non_panel_process.cpp b/Telegram/SourceFiles/payments/payments_non_panel_process.cpp index 12fb6a13f..62a3b4681 100644 --- a/Telegram/SourceFiles/payments/payments_non_panel_process.cpp +++ b/Telegram/SourceFiles/payments/payments_non_panel_process.cpp @@ -16,9 +16,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "history/history_item.h" #include "history/history_item_components.h" #include "main/main_session.h" +#include "mainwidget.h" #include "payments/payments_checkout_process.h" // NonPanelPaymentForm. #include "payments/payments_form.h" #include "settings/settings_credits_graphics.h" +#include "ui/boxes/boost_box.h" // Ui::StartFireworks. #include "ui/layers/generic_box.h" #include "ui/text/format_values.h" #include "window/window_session_controller.h" @@ -49,7 +51,12 @@ Fn ProcessNonPanelPaymentFormFactory( controller->session().user()); const auto sendBox = [=, weak = base::make_weak(controller)] { if (const auto strong = weak.get()) { - controller->uiShow()->show(Box(Ui::SendCreditsBox, form)); + controller->uiShow()->show(Box( + Ui::SendCreditsBox, + form, + crl::guard(strong, [=] { + Ui::StartFireworks(strong->content()); + }))); } }; const auto weak = base::make_weak(controller);