Skip to content

Commit

Permalink
[Bug] Fix account list pagination no response (#146)
Browse files Browse the repository at this point in the history
* Rename flag from 'pagesize' to 'pageSize'

* Remove redundant '%' character from type placeholder
  • Loading branch information
bivashy authored Jan 23, 2024
1 parent 00102b8 commit bd4e7ad
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class AccountsListCommand implements OrphanCommand {
@DefaultFor("~")
@CommandCooldown(CommandCooldown.DEFAULT_VALUE)
public void onAccountsMenu(LinkCommandActorWrapper actorWrapper, LinkType linkType, @Flag("page") @Default("1") Integer page,
@RenameTo(value = "size", type = "NUMBER") @Flag("pagesize") @Default("5") Integer accountsPerPage,
@RenameTo(value = "size", type = "NUMBER") @Flag("pageSize") @Default("5") Integer accountsPerPage,
@Flag("type") @Default("my") AccountListType type) {
if (!linkType.getSettings().isAdministrator(actorWrapper.userId()) && type.isAdministratorOnly) {
actorWrapper.reply(linkType.getLinkMessages().getMessage("not-enough-permission"));
Expand Down Expand Up @@ -65,7 +65,7 @@ private Keyboard createKeyboard(LinkType linkType, int currentPage, int accounts
int nextPage = currentPage + 1;
List<String> placeholdersList = new ArrayList<>(
Arrays.asList("%next_page%", Integer.toString(nextPage), "%previous_page%", Integer.toString(previousPage), "%prev_page%",
Integer.toString(currentPage - 1), "%pageSize%", Integer.toString(accountsPerPage), "%type%%", accountsType));
Integer.toString(currentPage - 1), "%pageSize%", Integer.toString(accountsPerPage), "%type%", accountsType));

for (int i = 1; i <= accounts.size(); i++) { // Create placeholders array
Account account = accounts.get(i - 1);
Expand Down

0 comments on commit bd4e7ad

Please sign in to comment.