Skip to content

Commit df9d45b

Browse files
committed
Merge pull request #109 from BlakeWilliams/bmw-fix-versions-requests
Use computed property for versions length
2 parents 4cdfb45 + aa769f0 commit df9d45b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

app/controllers/crate/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ export default Ember.ObjectController.extend({
3636
this.get('repository');
3737
}.property('homepage', 'wiki', 'mailing_list', 'documentation', 'repository'),
3838

39+
versionsCount: function() {
40+
return this.get('versions.length');
41+
}.property('versions.@each'),
42+
3943
displayedAuthors: function() {
4044
var self = this;
4145
if (!this.get('currentVersion')) {

app/templates/crate/index.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200
<div class='stat'>
201201
<span {{bind-attr class="crate.versions.isPending:loading :num"}}>
202202
<img src="/assets/package.png"/>
203-
{{ versions.length }}
203+
{{ versionsCount }}
204204
</span>
205205
<span class='desc small'>Versions published</span>
206206
</div>

0 commit comments

Comments
 (0)