From c115cd92a193f1de1604ac3e41ab1c9a97e1baa0 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Sat, 21 Sep 2024 15:12:11 +0100 Subject: [PATCH] Fix the dropdown having the wrong page value --- src/helpers/InventoryHelper.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/helpers/InventoryHelper.ts b/src/helpers/InventoryHelper.ts index 9075b30..714fb96 100644 --- a/src/helpers/InventoryHelper.ts +++ b/src/helpers/InventoryHelper.ts @@ -113,6 +113,8 @@ export default class InventoryHelper { .setStyle(ButtonStyle.Primary) .setDisabled(page + 1 == pages.length)); + let pageNum = 0; + const row2 = new ActionRowBuilder() .addComponents( new StringSelectMenuBuilder() @@ -123,7 +125,7 @@ export default class InventoryHelper { .setLabel(`${x.name} (${x.seriesSubpage + 1})`.substring(0, 100)) .setDescription("Quick navigate to page...") .setDefault(currentPage.id == x.id) - .setValue(x.id.toString())))); + .setValue((pageNum++).toString())))); const buffer = await ImageHelper.GenerateCardImageGrid(currentPage.cards.map(x => ({ id: x.id, path: x.path }))); const image = new AttachmentBuilder(buffer, { name: "page.png" });