Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Fix account list pagination no response #146

Merged
merged 2 commits into from
Jan 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading