Remove the need for the winner_count variable
This commit is contained in:
parent
a8ea86bf29
commit
bec5dff084
1 changed files with 2 additions and 4 deletions
|
|
@ -64,12 +64,10 @@ export default {
|
||||||
auth: request.auth,
|
auth: request.auth,
|
||||||
});
|
});
|
||||||
let data = JSON.parse(r.payload);
|
let data = JSON.parse(r.payload);
|
||||||
var winner_count = data.count;
|
|
||||||
|
|
||||||
// Check if we are getting rid of all winners
|
// Check if we are getting rid of all winners
|
||||||
if (data.eliminate_all) {
|
if (data.eliminate_all) {
|
||||||
quotes = [];
|
quotes = [];
|
||||||
winner_count = 0;
|
|
||||||
} else {
|
} else {
|
||||||
quotes = data.winners;
|
quotes = data.winners;
|
||||||
};
|
};
|
||||||
|
|
@ -105,11 +103,11 @@ export default {
|
||||||
type: 3,
|
type: 3,
|
||||||
custom_id: `quote`,
|
custom_id: `quote`,
|
||||||
placeholder: `Choose Your Favourite Quote`,
|
placeholder: `Choose Your Favourite Quote`,
|
||||||
options: quotes.map((_, i) => {
|
options: quotes.map((quote, i) => {
|
||||||
return {
|
return {
|
||||||
label: `Quote ${i + 1}`,
|
label: `Quote ${i + 1}`,
|
||||||
value: i,
|
value: i,
|
||||||
emoji: i < winner_count ? {
|
emoji: quote.win_streak > 0 ? {
|
||||||
name: `👑`
|
name: `👑`
|
||||||
} : null
|
} : null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue