Skip to content
Snippets Groups Projects
Commit 89bc1363 authored by deuce's avatar deuce
Browse files

Add a myvote() method.

parent 38130223
Branches
Tags
No related merge requests found
......@@ -72,17 +72,20 @@ function ConcensusObject(host, port, scope)
newissue.answers=this.answers;
this.db.write(this.scope, 'issues.'+this.index, newissue, LOCK_WRITE);
}
issue.havevoted=function()
issue.myvote=function()
{
var i,j;
for(i in this.answers) {
for(j in this.answers[i].votes) {
if(this.answers[i].votes[j]==user.alias)
return true;
return this.answers[i].value;
}
}
return false;
}
issue.havevoted=function()
{
return this.myvote()!=undefined;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment