Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.

Store voting history in local storage #64

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

MaxStalker
Copy link

Testing it now..

@MaxStalker
Copy link
Author

Seem to be working :)
image

Copy link

@johannbarbie johannbarbie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dangerous use of js number for things that should be BN.

history.map(item => {
const {type, votes, proposalId, timestamp} = item;
let suffix = "Voice Credit";
if (Math.abs(votes) !== 1 ) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

always use BN

// Store voting action in history
this.storeVotingAction({
type: "cast",
votes: sign * newVotesTotal,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

always use BN

// Store voting action in history
this.storeVotingAction({
type: "withdraw",
votes: parseInt(votes),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only use BN

@troggy troggy removed their request for review December 31, 2019 10:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants