Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
christinna9031 committed Mar 9, 2024
2 parents 1b0a4e8 + d11f40c commit 73b7a61
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion download/bridge.html

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions download/bridge_unminified.html
Original file line number Diff line number Diff line change
Expand Up @@ -2306,7 +2306,7 @@ <h5>YouTube Live Test Triggers</h5>
};
sendTriggerToSAMMI(
5,
`${pullData.user_name} donated ${amount} bits! [test trigger]`,
`${pullData.display_name} donated ${amount} bits! [test trigger]`,
{
amount,
},
Expand Down Expand Up @@ -2404,7 +2404,7 @@ <h5>YouTube Live Test Triggers</h5>
,
SAMMITestTwitchPoll(form) {
const pollSelect = form.elements['pollType'];
const amount = form.elements['pollChoiceAmount'].value || getRandomInt(2, 5);
const amount = parseInt(form.elements['pollChoiceAmount'].value) || getRandomInt(2, 5);
const duration = form.elements['pollDuration'].value || getRandomInt(60, 600);
const type = pollSelect.options[pollSelect.selectedIndex].text || 'Created';
const typeNum = type === 'Created' ? 0 : type === 'Voted' ? 1 : type === 'Ended' ? 2 : 3;
Expand All @@ -2416,7 +2416,7 @@ <h5>YouTube Live Test Triggers</h5>
event: type,
poll_id: '9dd6a7a7-78f4-46ef-b674-e2864ad7fa07',
poll_name: 'My Test Poll',
choice_amount: parseInt(amount),
choice_amount: amount,
vote_total: voteTotal,
vote_total_base: 0,
vote_total_bits: 0,
Expand Down Expand Up @@ -2844,8 +2844,11 @@ <h5>YouTube Live Test Triggers</h5>
// split total votes into parts for each choice
const choiceVotesSplit = [...splitNParts(voteTotal, amount)];
const topVotes = { ...choiceVotesSplit };
const topVotesSorted = Object.keys(topVotes).sort((a, b) => parseInt(topVotes[b]) - parseInt(topVotes[a]));
obj.top_vote_list = topVotesSorted;
const topVotesSorted = Object.keys(topVotes)
.sort((a, b) => parseInt(topVotes[b]) - parseInt(topVotes[a]))
.map(key => parseInt(key));

obj.top_vote_list = topVotesSorted;

for (let i = 0; i < amount; i++) {
const choiceInfo = {};
Expand Down

0 comments on commit 73b7a61

Please sign in to comment.