Skip to content

Commit 5feda69

Browse files
committed
controllers/crate/version: Simplify "extraDownloads" property
1 parent 4bafb5d commit 5feda69

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

app/controllers/crate/version.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ export default Ember.Controller.extend({
1212
return this.get('requestedVersion') ? this.get('model') : this.get('crate');
1313
}),
1414
downloads: computed.alias('downloadsContext.version_downloads'),
15-
extraDownloads: computed('downloads.content.meta.extra_downloads', function() {
16-
return this.get('downloads.content.meta.extra_downloads') || [];
17-
}),
15+
extraDownloads: computed.alias('downloads.content.meta.extra_downloads'),
1816

1917
fetchingFollowing: true,
2018
following: false,
@@ -111,11 +109,13 @@ export default Ember.Controller.extend({
111109
},
112110

113111
downloadData: computed('downloads', 'extraDownloads', 'requestedVersion', function() {
114-
let { downloads, extraDownloads: extra } = this.getProperties('downloads', 'extraDownloads');
115-
if (!downloads || !extra) {
112+
let downloads = this.get('downloads');
113+
if (!downloads) {
116114
return;
117115
}
118116

117+
let extra = this.get('extraDownloads') || [];
118+
119119
var dates = {};
120120
var versions = [];
121121
for (var i = 0; i < 90; i++) {

0 commit comments

Comments
 (0)