From 0188719d0426e4768d8a09b582b5442d522bf84c Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 1 Apr 2021 09:05:02 +0400 Subject: [PATCH] Fix payments with zero tips. --- Telegram/SourceFiles/payments/payments_checkout_process.cpp | 6 ++++-- Telegram/SourceFiles/payments/payments_form.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/payments/payments_checkout_process.cpp b/Telegram/SourceFiles/payments/payments_checkout_process.cpp index ba91af348..1a60cf4b8 100644 --- a/Telegram/SourceFiles/payments/payments_checkout_process.cpp +++ b/Telegram/SourceFiles/payments/payments_checkout_process.cpp @@ -566,7 +566,8 @@ void CheckoutProcess::getPasswordState( } void CheckoutProcess::panelChooseShippingOption() { - if (_submitState != SubmitState::None) { + if (_submitState != SubmitState::None + && _submitState != SubmitState::Validated) { return; } chooseShippingOption(); @@ -578,7 +579,8 @@ void CheckoutProcess::panelChangeShippingOption(const QString &id) { } void CheckoutProcess::panelChooseTips() { - if (_submitState != SubmitState::None) { + if (_submitState != SubmitState::None + && _submitState != SubmitState::Validated) { return; } chooseTips(); diff --git a/Telegram/SourceFiles/payments/payments_form.cpp b/Telegram/SourceFiles/payments/payments_form.cpp index c1b001af1..d6cf8976f 100644 --- a/Telegram/SourceFiles/payments/payments_form.cpp +++ b/Telegram/SourceFiles/payments/payments_form.cpp @@ -476,7 +476,7 @@ void Form::submit() { | (_shippingOptions.selectedId.isEmpty() ? Flag(0) : Flag::f_shipping_option_id) - | (_invoice.tipsSelected ? Flag::f_tip_amount : Flag(0))), + | (_invoice.tipsMax > 0 ? Flag::f_tip_amount : Flag(0))), MTP_long(_details.formId), _peer->input, MTP_int(_msgId),