Bug 595333 - Downloads started during DownloadView initialization are added twice [r=mfinkle]

This commit is contained in:
Wesley Johnston 2010-09-10 23:45:53 -04:00
Родитель 8bedc9c8f0
Коммит 53ac8bc028
1 изменённых файлов: 19 добавлений и 16 удалений

Просмотреть файл

@ -73,7 +73,10 @@ var DownloadsView = {
}, },
_createItem: function dv__createItem(aAttrs) { _createItem: function dv__createItem(aAttrs) {
let item = document.createElement("richlistitem"); // Make sure this doesn't already exist
let item = this.getElementForDownload(aAttrs.id);
if (!item) {
item = document.createElement("richlistitem");
// Copy the attributes from the argument into the item // Copy the attributes from the argument into the item
for (let attr in aAttrs) for (let attr in aAttrs)
@ -89,7 +92,7 @@ var DownloadsView = {
// Initialize more complex attributes // Initialize more complex attributes
this._updateTime(item); this._updateTime(item);
this._updateStatus(item); this._updateStatus(item);
}
return item; return item;
}, },