mirror of
https://github.com/zotero/zotero.git
synced 2026-09-07 08:26:14 +00:00
fix createParent dialog stuck during quicksearch (#5596)
Fix createParentDialog hanging when opened during quicksearch or in saved search. After a parent item is added, itemTree is being refreshed. If _refreshPromise is resolved after a timeout, it will not complete until the modal dialog is closed. Instead, resolve _refreshPromise after Zotero.Promise.delay, which uses the XPCOM global timer unaffected by modals. Fixes: #3026
This commit is contained in:
parent
18f3557742
commit
7df3dafb9e
1 changed files with 4 additions and 6 deletions
|
|
@ -375,14 +375,12 @@ var ItemTree = class ItemTree extends LibraryTree {
|
|||
|
||||
await this.runListeners('refresh');
|
||||
|
||||
setTimeout(function () {
|
||||
resolve();
|
||||
});
|
||||
await Zotero.Promise.delay();
|
||||
resolve();
|
||||
}
|
||||
catch (e) {
|
||||
setTimeout(function () {
|
||||
reject(e);
|
||||
});
|
||||
await Zotero.Promise.delay();
|
||||
reject(e);
|
||||
throw e;
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue