Hide veto button for confirmed reimbursements
This commit is contained in:
@@ -10,6 +10,18 @@ export default class ReimbursementItemComponent extends Component {
|
|||||||
return config.ipfs.gatewayUrl;
|
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
|
@action
|
||||||
veto (id) {
|
veto (id) {
|
||||||
this.kredits.vetoReimbursement(id).then(transaction => {
|
this.kredits.vetoReimbursement(id).then(transaction => {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
class="button small" target="_blank" rel="noopener noreferrer">
|
class="button small" target="_blank" rel="noopener noreferrer">
|
||||||
Inspect IPFS data
|
Inspect IPFS data
|
||||||
</a>
|
</a>
|
||||||
{{#if this.kredits.currentUserIsCore}}
|
{{#if this.showVetoButton}}
|
||||||
<button {{on "click" (fn this.veto @reimbursement.id)}}
|
<button {{on "click" (fn this.veto @reimbursement.id)}}
|
||||||
disabled={{@reimbursement.vetoed}}
|
disabled={{@reimbursement.vetoed}}
|
||||||
class="button small danger" type="button">veto</button>
|
class="button small danger" type="button">veto</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user