Skip to content

Commit

Permalink
Fix app update for marathon 1.4.x
Browse files Browse the repository at this point in the history
Since Marathon 1.4.x, it seems that app versions are not returned in a
specific order, but some of the logic in marathon-ui relies on it. This
is fixed by sorting the versions list received in descending order, as
it was returned by previous Marathon versions.
  • Loading branch information
jbonjean committed Feb 8, 2017
1 parent bf6ced4 commit 4716e7f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/js/stores/AppVersionsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,16 @@ var AppVersionsStore = Util.extendObject(EventEmitter.prototype, {

getAppVersions: function (appId) {
if (appId === storeData.currentAppId) {
return this.availableAppVersions;
return this.availableAppVersions
.sort(function (a, b) {
if (a < b) {
return 1;
}
if (a > b) {
return -1;
}
return 0;
});
}
return [];
},
Expand Down

0 comments on commit 4716e7f

Please sign in to comment.