Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Fix eslint violations
Browse files Browse the repository at this point in the history
  • Loading branch information
slaweet committed Apr 26, 2017
1 parent 7b2ca67 commit 130f339
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/app/components/delegates/delegates.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ app.component('delegates', {

checkPendingVotes() {
this.$timeout(() => {
this.delegateService.listAccountDelegates(this.account
this.delegateService.listAccountDelegates(this.account,
).then((data) => {
this.votedList = data.delegates || [];
this.votedDict = {};
Expand Down Expand Up @@ -216,7 +216,7 @@ app.component('delegates', {
this._selectDelegate(delegate, list);
} else {
this.pendingRequests++;
this.delegateService.getDelegate(username
this.delegateService.getDelegate(username,
).then((data) => {
this._selectDelegate(data.delegate, list);
}).catch(() => {
Expand Down
19 changes: 9 additions & 10 deletions src/app/services/delegateService.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
app.factory('delegateService', ($peers) => ({
app.factory('delegateService', $peers => ({
listAccountDelegates(options) {
return $peers.sendRequestPromise('accounts/delegates', options);
},
Expand All @@ -10,25 +10,24 @@ app.factory('delegateService', ($peers) => ({
getDelegate(options) {
return $peers.sendRequestPromise('delegates/get', options);
},

vote(options) {
return $peers.sendRequestPromise('accounts/delegates', {
secret: options.secret,
publicKey: options.publicKey,
secondSecret: options.secondSecret,
delegates: options.voteList.map(delegate => `+${delegate.publicKey}`).concat(
secret: options.secret,
publicKey: options.publicKey,
secondSecret: options.secondSecret,
delegates: options.voteList.map(delegate => `+${delegate.publicKey}`).concat(
options.unvoteList.map(delegate => `-${delegate.publicKey}`)),
});
});
},

voteAutocomplete(username, votedDict) {
return this.listDelegates({q: username
}).then(response => response.delegates.filter(d => !votedDict[d.username]));
return this.listDelegates({ q: username,
}).then(response => response.delegates.filter(d => !votedDict[d.username]));
},

unvoteAutocomplete(username, votedList) {
return votedList.filter(delegate => delegate.username.indexOf(username) !== -1);
},
}));


0 comments on commit 130f339

Please sign in to comment.