Don't start transaction to clear search temp table

This might fix loss of item focus when editing a note in a search,
possibly starting with fbf2fbe0c6.
This commit is contained in:
Dan Stillman 2017-11-27 17:29:14 -05:00
parent da387874a2
commit a70a517f7e

View File

@ -2360,10 +2360,11 @@ Zotero.CollectionTreeCache = {
this.lastTreeRow = null;
this.lastSearch = null;
if (this.lastTempTable) {
// Drop the last temp table when we can. We don't wait on this because it can cause a
// deadlock: this waits on open transactions, but a transaction could be waiting on
// ItemTreeView::notify(), which waits on ItemTreeView::refresh(), which calls this.
Zotero.DB.queryTx("DROP TABLE IF EXISTS " + this.lastTempTable).done();
let tableName = this.lastTempTable;
let id = Zotero.DB.addCallback('commit', async function () {
await Zotero.DB.queryAsync("DROP TABLE IF EXISTS " + tableName);
Zotero.DB.removeCallback('commit', id);
});
}
this.lastTempTable = null;
this.lastResults = null;