6b87c641d9
If a view or other resources are destroyed while a promise is being resolved, subsequent code can fail. This is generally harmless, but it results in unnecessary errors being logged to the console. To address this, promises can use a new function, Zotero.Promise.check(), to test whether a value is truthy or 0 and automatically throw a specific error that's ignored by the unhandled rejection handler if not. Example usage: getAsync().tap(() => Zotero.Promise.check(this.win)); If this.win is cleaned up while getAsync() is being resolved, subsequent lines won't be run, and nothing will be logged to the console. |
||
---|---|---|
.. | ||
content | ||
locale | ||
skin/default/zotero |