fixed contract participants not shown issue
This commit is contained in:
parent
62e7f8b20a
commit
78ff09ba37
18
index.html
18
index.html
@ -1638,19 +1638,13 @@
|
||||
// Consolidate participants with same address and choice
|
||||
const consolidatedParticipants = {}
|
||||
for (const participant in contractParticipants) {
|
||||
const { participantFloAddress, tokenAmount, tokenIdentification, transactionHash, userChoice, winningAmount } = contractParticipants[participant]
|
||||
if (!consolidatedParticipants[`${participantFloAddress}-${userChoice}`]) {
|
||||
consolidatedParticipants[`${participantFloAddress}-${userChoice}`] = {
|
||||
participantFloAddress,
|
||||
tokenAmount,
|
||||
tokenIdentification,
|
||||
transactionHash,
|
||||
userChoice,
|
||||
winningAmount
|
||||
}
|
||||
const { participantFloAddress, tokenAmount, userChoice, winningAmount } = contractParticipants[participant]
|
||||
const id = userChoice ? `${participantFloAddress}-${userChoice}` : participantFloAddress
|
||||
if (!consolidatedParticipants[id]) {
|
||||
consolidatedParticipants[id] = contractParticipants[participant]
|
||||
} else {
|
||||
consolidatedParticipants[`${participantFloAddress}-${userChoice}`].tokenAmount += tokenAmount
|
||||
consolidatedParticipants[`${participantFloAddress}-${userChoice}`].winningAmount += winningAmount
|
||||
consolidatedParticipants[id].tokenAmount += tokenAmount
|
||||
consolidatedParticipants[id].winningAmount += winningAmount
|
||||
}
|
||||
}
|
||||
for (const participant in consolidatedParticipants) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user