Fix error deleting selected library
This commit is contained in:
parent
1633a73c3e
commit
f7074a75b5
2 changed files with 10 additions and 1 deletions
|
@ -360,7 +360,12 @@ Zotero.CollectionTreeView.prototype.notify = Zotero.Promise.coroutine(function*
|
|||
// If there's not at least one new collection to be selected, get a scroll position to restore later
|
||||
var scrollPosition = false;
|
||||
if (action != 'add' || ids.every(id => extraData[id] && extraData[id].skipSelect)) {
|
||||
scrollPosition = this._saveScrollPosition();
|
||||
if (action == 'delete' && (type == 'group' || type == 'feed')) {
|
||||
// Don't try to access deleted library
|
||||
}
|
||||
else {
|
||||
scrollPosition = this._saveScrollPosition();
|
||||
}
|
||||
}
|
||||
|
||||
if (action == 'delete') {
|
||||
|
|
|
@ -409,6 +409,10 @@ describe("Zotero.CollectionTreeView", function() {
|
|||
// Group, collections, Duplicates, Unfiled, and trash
|
||||
assert.equal(cv.rowCount, originalRowCount + 9);
|
||||
|
||||
// Select group
|
||||
yield cv.selectLibrary(group.libraryID);
|
||||
yield waitForItemsLoad(win);
|
||||
|
||||
var spy = sinon.spy(cv, "refresh");
|
||||
try {
|
||||
yield group.eraseTx();
|
||||
|
|
Loading…
Add table
Reference in a new issue