Created
June 8, 2020 13:19
-
-
Save Tschakki/cff8389ac7466facc0632bb4ad26b374 to your computer and use it in GitHub Desktop.
Decentralized Organization Chain - Add Poll tx snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (recipient.asset.poll.votes) { | |
let votes = recipient.asset.poll.votes; | |
if (votes[vote]) { | |
++votes[vote]; | |
recipient.asset.poll.votes = votes; | |
} else { | |
recipient.asset.poll.votes = { ...votes, [vote]: 1 }; | |
} | |
} else { | |
recipient.asset.poll.votes = { [vote]: 1 }; | |
} | |
store.account.set(recipient.address, recipient); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment