diff --git a/app/components/proposal-list/component.js b/app/components/proposal-list/component.js
index 4c7c212..1ce555d 100644
--- a/app/components/proposal-list/component.js
+++ b/app/components/proposal-list/component.js
@@ -12,6 +12,13 @@ export default Component.extend({
submitButtonDisabled: empty('selectedProposals'),
actions: {
+ confirm() {
+ this.confirmProposals(this.selectedProposals)
+ .then(() => {
+ this.selectedProposals = [];
+ });
+ },
+
toggleSelect(proposalId, selected) {
if (selected) {
this.selectedProposals.removeObject(proposalId);
diff --git a/app/components/proposal-list/template.hbs b/app/components/proposal-list/template.hbs
index 330867f..e12313a 100644
--- a/app/components/proposal-list/template.hbs
+++ b/app/components/proposal-list/template.hbs
@@ -8,10 +8,7 @@
{{#if confirmProposals}}
-
diff --git a/app/controllers/index.js b/app/controllers/index.js
index 1504b4c..868b76d 100644
--- a/app/controllers/index.js
+++ b/app/controllers/index.js
@@ -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();
}
},