From b30e8deb68941aaf86f75336d283f95110f96523 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Mon, 19 Jul 2021 15:41:21 -0600 Subject: [PATCH] Make it so all quotes aren't marked as winners in the brackets --- src/endpoints/management/create_bracket.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/endpoints/management/create_bracket.ts b/src/endpoints/management/create_bracket.ts index 0c74f32..e4e4660 100644 --- a/src/endpoints/management/create_bracket.ts +++ b/src/endpoints/management/create_bracket.ts @@ -30,6 +30,7 @@ export default { // Calculate the winners from the previous bracket let r = await request.server.inject(`/bracket/winners`); var quotes: string[] = JSON.parse(r.payload).winners; + var winner_count = quotes.length; // Ensure that the all elimination limit didn't get hit if (quotes.length > Math.floor(config.discord.quote_max / 2)) { @@ -53,7 +54,7 @@ export default { { description: `Note: If **more than ${Math.floor(config.discord.quote_max / 2)}** of the quotes tie, they will all be eliminated, otherwise, the ones that tie will move on to the next bracket.`, fields: quotes.map((quote, i) => { return { - name: `${i < quotes.length ? '👑 ' : ''}Quote: ${i + 1}`, + name: `${i < winner_count ? '👑 ' : ''}Quote: ${i + 1}`, value: quote, }}), } @@ -70,7 +71,7 @@ export default { return { label: `Quote ${i + 1}`, value: i, - emoji: i < quotes.length ? { + emoji: i < winner_count ? { name: `👑` } : null }