Skip to content

Commit c0bc71c

Browse files
committed
Fix the series view next button not disabling when on the last page (#300)
- Fix the button disable logic on the `/series view` command not disabling the next button on the last page #298 Reviewed-on: https://git.vylpes.xyz/External/card-drop/pulls/300 Reviewed-by: VylpesTester <tester@vylpes.com> Co-authored-by: Ethan Lane <ethan@vylpes.com> Co-committed-by: Ethan Lane <ethan@vylpes.com>
1 parent 42e7bda commit c0bc71c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/helpers/SeriesHelper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default class SeriesHelper {
5252
.setCustomId(`series view ${seriesId} ${page + 1}`)
5353
.setLabel("Next")
5454
.setStyle(ButtonStyle.Primary)
55-
.setDisabled(page + 1 > totalPages));
55+
.setDisabled(page + 1 == totalPages));
5656

5757
const buffer = await ImageHelper.GenerateCardImageGrid(cardsOnPage.map(x => ({id: x.id, path: x.path})), userId);
5858
const image = new AttachmentBuilder(buffer, { name: "page.png" });
@@ -98,7 +98,7 @@ export default class SeriesHelper {
9898
.setCustomId(`series list ${page + 1}`)
9999
.setLabel("Next")
100100
.setStyle(ButtonStyle.Primary)
101-
.setDisabled(page + 1 > totalPages));
101+
.setDisabled(page + 1 == totalPages));
102102

103103
return { embed, row };
104104
}

0 commit comments

Comments
 (0)