Profile: Fix showcase card being out of order.

The showcase cards were rendered based on the order in which
the render calls returned within the slots.map call.
Using the original slot keys fixes this issue.
This commit is contained in:
2023-08-04 12:07:47 +02:00
parent 24510dcc4c
commit 696d0f136d

View File

@@ -38,9 +38,9 @@ module.exports = {
if (card) { if (card) {
console.log(`Iterating card ${card.id}`); console.log(`Iterating card ${card.id}`);
let cardImage = await Rendering.renderCard(card); let cardImage = await Rendering.renderCard(card);
renderedCards.push(cardImage); renderedCards[slot] = cardImage;
} else { } else {
renderedCards.push(`${process.env.ASSET_URL}/cards/card_cover.png`); renderedCards[slot] = `${process.env.ASSET_URL}/cards/card_cover.png`;
} }
})); }));
@@ -53,7 +53,7 @@ module.exports = {
"elements": [ "elements": [
{ {
"type": "image", "type": "image",
"asset": `${renderedCards[0]}`, "asset": `${renderedCards['slotOne']}`,
"x": 25, "x": 25,
"y": 85, "y": 85,
"width": 300, "width": 300,
@@ -61,7 +61,7 @@ module.exports = {
}, },
{ {
"type": "image", "type": "image",
"asset": `${renderedCards[1]}`, "asset": `${renderedCards['slotTwo']}`,
"x": 375, "x": 375,
"y": 310, "y": 310,
"width": 175, "width": 175,
@@ -69,7 +69,7 @@ module.exports = {
}, },
{ {
"type": "image", "type": "image",
"asset": `${renderedCards[2]}`, "asset": `${renderedCards['slotThree']}`,
"x": 560, "x": 560,
"y": 310, "y": 310,
"width": 175, "width": 175,
@@ -77,7 +77,7 @@ module.exports = {
}, },
{ {
"type": "image", "type": "image",
"asset": `${renderedCards[3]}`, "asset": `${renderedCards['slotFour']}`,
"x": 745, "x": 745,
"y": 310, "y": 310,
"width": 175, "width": 175,
@@ -155,6 +155,9 @@ module.exports = {
} }
console.log("Fetching ", ); console.log("Fetching ", );
if(process.env.NODE_ENV === "development") {
await interaction.channel.send(`\`\`\`${JSON.stringify(job)}\`\`\``);
}
let { data } = await axios.post(`${process.env.JOSE_ENDPOINT}/jobs`, job); let { data } = await axios.post(`${process.env.JOSE_ENDPOINT}/jobs`, job);
console.log("Fetched ", data); console.log("Fetched ", data);
await interaction.editReply({ files: [data["path"]] }); await interaction.editReply({ files: [data["path"]] });