From bec5dff0847392b0e4ccf276d7628b4c84fa5735 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Thu, 30 Sep 2021 12:53:32 -0600 Subject: [PATCH] Remove the need for the winner_count variable --- server/src/endpoints/management/create_bracket.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/server/src/endpoints/management/create_bracket.ts b/server/src/endpoints/management/create_bracket.ts index 3d1569a..79673ea 100644 --- a/server/src/endpoints/management/create_bracket.ts +++ b/server/src/endpoints/management/create_bracket.ts @@ -64,12 +64,10 @@ export default { auth: request.auth, }); let data = JSON.parse(r.payload); - var winner_count = data.count; // Check if we are getting rid of all winners if (data.eliminate_all) { quotes = []; - winner_count = 0; } else { quotes = data.winners; }; @@ -105,11 +103,11 @@ export default { type: 3, custom_id: `quote`, placeholder: `Choose Your Favourite Quote`, - options: quotes.map((_, i) => { + options: quotes.map((quote, i) => { return { label: `Quote ${i + 1}`, value: i, - emoji: i < winner_count ? { + emoji: quote.win_streak > 0 ? { name: `👑` } : null }