mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 13:17:08 +02:00
Fixed cases when list of top-up credit options is empty.
This commit is contained in:
parent
7e01b12825
commit
06075411a5
2 changed files with 6 additions and 2 deletions
|
@ -264,7 +264,7 @@ private:
|
|||
bool forceFullCancel = false;
|
||||
bool jumpBackToSearchedChat = false;
|
||||
};
|
||||
bool cancelSearch(CancelSearchOptions options = {});
|
||||
bool cancelSearch(CancelSearchOptions options);
|
||||
|
||||
MTP::Sender _api;
|
||||
|
||||
|
|
|
@ -165,7 +165,7 @@ QImage GenerateStars(int height, int count) {
|
|||
void FillCreditOptions(
|
||||
not_null<Window::SessionController*> controller,
|
||||
not_null<Ui::VerticalLayout*> container,
|
||||
int minCredits,
|
||||
int minimumCredits,
|
||||
Fn<void()> paid) {
|
||||
const auto options = container->add(
|
||||
object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>(
|
||||
|
@ -191,6 +191,10 @@ void FillCreditOptions(
|
|||
- st.iconLeft
|
||||
- singleStarWidth;
|
||||
const auto buttonHeight = st.height + rect::m::sum::v(st.padding);
|
||||
const auto minCredits = (!options.empty()
|
||||
&& (minimumCredits > options.back().credits))
|
||||
? 0
|
||||
: minimumCredits;
|
||||
for (auto i = 0; i < options.size(); i++) {
|
||||
const auto &option = options[i];
|
||||
if (option.credits < minCredits) {
|
||||
|
|
Loading…
Add table
Reference in a new issue