mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-17 22:57:11 +02:00
Added fireworks effect on success credit sending.
This commit is contained in:
parent
7d75c25214
commit
0bd780b20f
3 changed files with 13 additions and 3 deletions
|
@ -43,7 +43,8 @@ namespace Ui {
|
|||
|
||||
void SendCreditsBox(
|
||||
not_null<Ui::GenericBox*> box,
|
||||
std::shared_ptr<Payments::CreditsFormData> form) {
|
||||
std::shared_ptr<Payments::CreditsFormData> form,
|
||||
Fn<void()> 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());
|
||||
|
|
|
@ -19,6 +19,7 @@ class GenericBox;
|
|||
|
||||
void SendCreditsBox(
|
||||
not_null<Ui::GenericBox*> box,
|
||||
std::shared_ptr<Payments::CreditsFormData> data);
|
||||
std::shared_ptr<Payments::CreditsFormData> data,
|
||||
Fn<void()> sent);
|
||||
|
||||
} // namespace Ui
|
||||
|
|
|
@ -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<void(NonPanelPaymentForm)> 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);
|
||||
|
|
Loading…
Add table
Reference in a new issue