fix: 1 userTitle case error
This commit is contained in:
parent
3bbd2c2818
commit
d6194ec8be
1 changed files with 5 additions and 1 deletions
|
|
@ -35,6 +35,10 @@ TgBot::InlineKeyboardMarkup::Ptr KeyboardFactory::createMyTitles(std::vector<Bot
|
|||
row.clear();
|
||||
}
|
||||
}
|
||||
if (!row.empty()) {
|
||||
layout.push_back(row);
|
||||
row.clear();
|
||||
}
|
||||
|
||||
// TODO: Додумать логику, когда пришло 6 записей в конце
|
||||
if(counter % 2 == 1) {
|
||||
|
|
@ -46,7 +50,7 @@ TgBot::InlineKeyboardMarkup::Ptr KeyboardFactory::createMyTitles(std::vector<Bot
|
|||
else {
|
||||
button->callbackData = BotConstants::Callback::LIST_PREV + ':' + std::to_string(titles[0].num);
|
||||
}
|
||||
layout[counter / 2].push_back(button);
|
||||
layout.back().push_back(button);
|
||||
}
|
||||
else {
|
||||
auto button_prev = std::make_shared<TgBot::InlineKeyboardButton>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue