Hide confirmed-in content when confirmed
This commit is contained in:
@@ -17,4 +17,8 @@ export default class ConfirmedInComponent extends Component {
|
||||
get confirmedInHumanTime () {
|
||||
return moment.duration(this.confirmedInSeconds, "seconds").humanize();
|
||||
}
|
||||
|
||||
get isConfirmed () {
|
||||
return this.confirmedInBlocks <= 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
{{#unless this.isConfirmed}}
|
||||
Confirming in <strong>{{this.confirmedInBlocks}}</strong> blocks (~ {{this.confirmedInHumanTime}})
|
||||
{{/unless}}
|
||||
|
||||
@@ -37,4 +37,13 @@ module('Unit | Component | confirmed-in', function(hooks) {
|
||||
|
||||
assert.equal(component.confirmedInHumanTime, '4 hours');
|
||||
})
|
||||
|
||||
test('#isConfirmed', function(assert) {
|
||||
const kredits = this.owner.lookup('service:kredits');
|
||||
kredits.set('currentBlock', 430000);
|
||||
let component = createComponent('component:confirmed-in');
|
||||
component.args.confirmedAtBlock = 420000;
|
||||
|
||||
assert.ok(component.isConfirmed);
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user