From bd4e7adec0e85e9e88251ca0f02193be00f7d11e Mon Sep 17 00:00:00 2001 From: bivashy <85439143+bivashy@users.noreply.github.com> Date: Tue, 23 Jan 2024 22:44:58 +0600 Subject: [PATCH] [Bug] Fix account list pagination no response (#146) * Rename flag from 'pagesize' to 'pageSize' * Remove redundant '%' character from type placeholder --- .../auth/messenger/commands/AccountsListCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/me/mastercapexd/auth/messenger/commands/AccountsListCommand.java b/core/src/main/java/me/mastercapexd/auth/messenger/commands/AccountsListCommand.java index 36752cf4..2e65572b 100644 --- a/core/src/main/java/me/mastercapexd/auth/messenger/commands/AccountsListCommand.java +++ b/core/src/main/java/me/mastercapexd/auth/messenger/commands/AccountsListCommand.java @@ -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")); @@ -65,7 +65,7 @@ private Keyboard createKeyboard(LinkType linkType, int currentPage, int accounts int nextPage = currentPage + 1; List 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);