Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Voting: fix bug with votes not loading initially #812

Merged
merged 2 commits into from
Apr 17, 2019
Merged

Voting: fix bug with votes not loading initially #812

merged 2 commits into from
Apr 17, 2019

Conversation

2color
Copy link
Contributor

@2color 2color commented Apr 17, 2019

No description provided.

@2color 2color requested a review from sohkai April 17, 2019 16:51
@@ -26,6 +32,8 @@ function appStateReducer(state) {
tokenDecimals: tokenDecimalsNum,
},

connectedAccountVotes: connectedAccountVotes || {},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is to ensure there's an object in

open: isVoteOpen(vote, now),
},
connectedAccountVote: connectedAccountVotes[vote.voteId] || VOTE_ABSENT,
}))

@@ -222,7 +224,7 @@ async function startVote(state, { creator, metadata, voteId }) {
* *
***********************/

async function getAccountVotes({ connectedAccount, votes }) {
async function getAccountVotes({ connectedAccount, votes = [] }) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we leave a comment for why we need to default this?

Copy link
Contributor

@sohkai sohkai left a comment

Choose a reason for hiding this comment

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

LGTM, I think I was the one that asked if we could remove the default for votes D:.

@2color
Copy link
Contributor Author

2color commented Apr 17, 2019

LGTM, I think I was the one that asked if we could remove the default for votes D:.

A comment in the first place would have prevented that :)

@2color 2color merged commit 0bf6ff4 into master Apr 17, 2019
@sohkai sohkai deleted the fix-voting branch April 17, 2019 17:04
ramilexe pushed a commit to ConsiderItDone/aragon-apps that referenced this pull request Dec 9, 2021
* Voting: fix bug with votes not loading initially

* Add comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants