Skip to content

Commit 116baac

Browse files
committed
controllers/crate/version: Extract computed "extraDownloads" property
1 parent c7cdcb8 commit 116baac

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

app/controllers/crate/version.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ export default Ember.Controller.extend({
1010
isDownloading: false,
1111

1212
fetchingDownloads: true,
13+
extraDownloads: Ember.computed('downloads.meta.extra_downloads', function() {
14+
return this.get('downloads.meta.extra_downloads') || [];
15+
}),
16+
1317
fetchingFollowing: true,
1418
following: false,
1519
currentVersion: computed.alias('model'),

app/routes/crate/version.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export default Ember.Route.extend({
5555
context.get('version_downloads').then(downloads => {
5656
controller.set('fetchingDownloads', false);
5757
controller.set('downloads', downloads);
58-
controller.set('extraDownloads', downloads.get('meta.extra_downloads') || []);
5958
});
6059
},
6160

0 commit comments

Comments
 (0)