FIX: ensures we have data to compute average (#7685)

This commit is contained in:
Joffrey JAFFEUX 2019-06-04 11:21:55 +02:00 committed by GitHub
parent b79d02ff48
commit 4283281397
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -31,9 +31,14 @@ export default Ember.Component.extend({
return reportTotal && total && twoColumns;
},
@computed("model.average", "totalsForSample.1.value", "twoColumns")
showAverage(reportAverage, totalValue, twoColumns) {
return reportAverage && totalValue && twoColumns;
@computed("model.{average,data}", "totalsForSample.1.value", "twoColumns")
showAverage(model, sampleTotalValue, hasTwoColumns) {
return (
model.average &&
model.data.length > 0 &&
sampleTotalValue &&
hasTwoColumns
);
},
@computed("totalsForSample.1.value", "model.data.length")