Handle pending changes for contributions

This adds the pending tx data to pending contributions (after adding or
vetoing, until the tx is mined). It also disables the veto button while
pending.
This commit is contained in:
2019-09-20 15:43:34 +02:00
parent 51d8b6c8c1
commit 1deecafee7
4 changed files with 25 additions and 3 deletions
+7 -1
View File
@@ -1,5 +1,5 @@
import EmberObject, { computed } from '@ember/object';
import { isEmpty } from '@ember/utils';
import { isEmpty, isPresent } from '@ember/utils';
import bignumber from 'kredits-web/utils/cps/bignumber';
import moment from 'moment';
@@ -24,6 +24,8 @@ export default EmberObject.extend({
time: null,
ipfsData: '',
pendingTx: null,
init () {
this._super(...arguments);
if (isEmpty(this.details)) this.set('details', {});
@@ -35,6 +37,10 @@ export default EmberObject.extend({
jsDate: computed('iso8601Date', function() {
return moment(this.iso8601Date).toDate();
}),
hasPendingChanges: computed('pendingTx', function() {
return isPresent(this.pendingTx);
})
});