We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
defaultVersion
1 parent bbca6ef commit 9816e49Copy full SHA for 9816e49
app/models/crate.js
@@ -31,6 +31,21 @@ export default class Crate extends Model {
31
@hasMany('categories', { async: true }) categories;
32
@hasMany('dependency', { async: true }) reverse_dependencies;
33
34
+ /**
35
+ * This is the default version that will be shown when visiting the crate
36
+ * details page. Note that this can be `undefined` if all versions of the crate
37
+ * have been yanked.
38
+ * @return {string}
39
+ */
40
+ get defaultVersion() {
41
+ if (this.max_stable_version) {
42
+ return this.max_stable_version;
43
+ }
44
+ if (this.max_version && this.max_version !== '0.0.0') {
45
+ return this.max_version;
46
47
48
+
49
follow = memberAction({ type: 'PUT', path: 'follow' });
50
unfollow = memberAction({ type: 'DELETE', path: 'follow' });
51
0 commit comments