diff --git a/app/components/reimbursement-item/component.js b/app/components/reimbursement-item/component.js index 1ada034..51e8b82 100644 --- a/app/components/reimbursement-item/component.js +++ b/app/components/reimbursement-item/component.js @@ -10,6 +10,18 @@ export default class ReimbursementItemComponent extends Component { return config.ipfs.gatewayUrl; } + get isConfirmed () { + return (this.args.reimbursement.confirmedAt - this.kredits.currentBlock) <= 0; + } + + get isUnconfirmed () { + return !this.isConfirmed; + } + + get showVetoButton () { + return this.isUnconfirmed && this.kredits.currentUserIsCore; + } + @action veto (id) { this.kredits.vetoReimbursement(id).then(transaction => { diff --git a/app/components/reimbursement-item/template.hbs b/app/components/reimbursement-item/template.hbs index 96828de..e3f4140 100644 --- a/app/components/reimbursement-item/template.hbs +++ b/app/components/reimbursement-item/template.hbs @@ -24,7 +24,7 @@ class="button small" target="_blank" rel="noopener noreferrer"> Inspect IPFS data - {{#if this.kredits.currentUserIsCore}} + {{#if this.showVetoButton}}