Fixed inconsistent progress state

This commit is contained in:
Björn Dahlgren
2015-04-17 20:06:48 +02:00
parent 594487a60e
commit 463c5c9322
2 changed files with 5 additions and 3 deletions

View File

@ -32,7 +32,8 @@ Mods.prototype.download = function (mod, cb) {
playwithsix.downloadMod(this.config.path, mod, {lite: this.liteMods}, function(err, mods) {
if (currentDownloadMod) {
delete currentDownloadMod.progress;
currentDownloadMod.progress = null;
self.emit('mods', self.mods);
}
self.updateMods();
cb(err, mods);
@ -54,7 +55,7 @@ Mods.prototype.download = function (mod, cb) {
outdated: false,
playWithSix: true,
};
self.mods = self.mods.push(currentDownloadMod);
self.mods.push(currentDownloadMod);
}
}
@ -85,6 +86,7 @@ Mods.prototype.updateMods = function () {
cb(null, {
name: mod,
outdated: outdatedMods && outdatedMods.indexOf(mod) >= 0,
progress: null,
playWithSix: isPlayWithSixMod,
});
});

View File

@ -6,7 +6,7 @@
<% } %>
</td>
<td>
<% if (typeof progress !== 'undefined') { %>
<% if (progress) { %>
<div class="progress" style="margin-bottom: 0;">
<div class="progress-bar" role="progressbar" aria-valuenow="<%-progress%>" aria-valuemin="0" aria-valuemax="100" style="width: <%-progress%>%; min-width: 2em;">
<%-progress%>%