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: #300 Reviewed-by: VylpesTester <tester@vylpes.com> Co-authored-by: Ethan Lane <ethan@vylpes.com> Co-committed-by: Ethan Lane <ethan@vylpes.com>
This commit is contained in:
parent
42e7bda1ce
commit
c0bc71c304
1 changed files with 2 additions and 2 deletions
|
@ -52,7 +52,7 @@ export default class SeriesHelper {
|
||||||
.setCustomId(`series view ${seriesId} ${page + 1}`)
|
.setCustomId(`series view ${seriesId} ${page + 1}`)
|
||||||
.setLabel("Next")
|
.setLabel("Next")
|
||||||
.setStyle(ButtonStyle.Primary)
|
.setStyle(ButtonStyle.Primary)
|
||||||
.setDisabled(page + 1 > totalPages));
|
.setDisabled(page + 1 == totalPages));
|
||||||
|
|
||||||
const buffer = await ImageHelper.GenerateCardImageGrid(cardsOnPage.map(x => ({id: x.id, path: x.path})), userId);
|
const buffer = await ImageHelper.GenerateCardImageGrid(cardsOnPage.map(x => ({id: x.id, path: x.path})), userId);
|
||||||
const image = new AttachmentBuilder(buffer, { name: "page.png" });
|
const image = new AttachmentBuilder(buffer, { name: "page.png" });
|
||||||
|
@ -98,7 +98,7 @@ export default class SeriesHelper {
|
||||||
.setCustomId(`series list ${page + 1}`)
|
.setCustomId(`series list ${page + 1}`)
|
||||||
.setLabel("Next")
|
.setLabel("Next")
|
||||||
.setStyle(ButtonStyle.Primary)
|
.setStyle(ButtonStyle.Primary)
|
||||||
.setDisabled(page + 1 > totalPages));
|
.setDisabled(page + 1 == totalPages));
|
||||||
|
|
||||||
return { embed, row };
|
return { embed, row };
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue