Skip to content

Commit

Permalink
fix: 选择模型的时候页面缺项 (#309)
Browse files Browse the repository at this point in the history
* fix: package.json 多余 &&

* fix: 模型选择页面缺项

---------

Co-authored-by: TBXark <[email protected]>
  • Loading branch information
Flying-Tom and TBXark authored Nov 28, 2024
1 parent 235754d commit 239539c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/lib/core/src/telegram/callback_query/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@ export class ModelListCallbackQueryHandler implements CallbackQueryHandler {

let currentRow: Telegram.InlineKeyboardButton[] = [];
for (let i = page * maxRow * maxCol; i < models.length; i++) {
currentRow.push({
text: models[i],
callback_data: `cm:${JSON.stringify([agent, models[i]])}`,
});
if (i % maxCol === 0) {
keyboard.push(currentRow);
currentRow = [];
}
if (keyboard.length >= maxRow) {
break;
}
currentRow.push({
text: models[i],
callback_data: `cm:${JSON.stringify([agent, models[i]])}`,
});
}
if (currentRow.length > 0) {
keyboard.push(currentRow);
Expand Down

0 comments on commit 239539c

Please sign in to comment.