Reset selectedProposals after confirmation

This commit is contained in:
2018-05-03 20:08:11 +02:00
committed by Sebastian Kippe
parent cb4d20cf81
commit 0e66765f1d
3 changed files with 12 additions and 5 deletions
+4 -1
View File
@@ -1,6 +1,7 @@
import Controller from '@ember/controller';
import { alias, filter, filterBy, sort } from '@ember/object/computed';
import { inject as injectService } from '@ember/service';
import RSVP from 'rsvp';
export default Controller.extend({
kredits: injectService(),
@@ -22,12 +23,14 @@ export default Controller.extend({
actions: {
confirmProposals(proposalIds) {
if (this.kredits.currentUser.isCore) {
this.kredits.batchVote(proposalIds)
return this.kredits.batchVote(proposalIds)
.then((transaction) => {
window.confirm('Vote submitted to Ethereum blockhain: '+transaction.hash);
return transaction;
});
} else {
window.alert('Only members can vote on proposals. Please ask someone to set you up.');
return RSVP.reject();
}
},