Fix: TypeError: "this._richlistbox.selectedItems.slice is not a function" in allDownloadsViewOverlay.js

Issue #121
This commit is contained in:
janekptacijarabaci 2018-04-14 03:15:56 +02:00 committed by Roy Tam
commit 65356126cc

View file

@ -1476,11 +1476,11 @@ DownloadsPlacesView.prototype = {
goUpdateCommand("downloadsCmd_clearDownloads");
break;
default: {
// Slicing the array to get a freezed list of selected items. Otherwise,
// the selectedItems array is live and doCommand may alter the selection
// while we are trying to do one particular action, like removing items
// from history.
let selectedElements = this._richlistbox.selectedItems.slice();
// Cloning the nodelist into an array to get a frozen list of selected items.
// Otherwise, the selectedItems nodelist is live and doCommand may alter the
// selection while we are trying to do one particular action, like removing
// items from history.
let selectedElements = [...this._richlistbox.selectedItems];
for (let element of selectedElements) {
element._shell.doCommand(aCommand);
}