Fix tag selector loading (broken by 6b87c641
)
This commit is contained in:
parent
8a93250ca1
commit
bd9c53b29c
|
@ -227,10 +227,10 @@
|
|||
var tagsToggleBox = this.id('tags-toggle');
|
||||
|
||||
var tagColors = yield Zotero.Tags.getColors(this.libraryID)
|
||||
.tap(() => Zotero.Promise.check(this.item));
|
||||
.tap(() => Zotero.Promise.check(this.mode));
|
||||
if (fetch || this._dirty) {
|
||||
this._tags = yield Zotero.Tags.getAll(this.libraryID, this._types)
|
||||
.tap(() => Zotero.Promise.check(this.item));
|
||||
.tap(() => Zotero.Promise.check(this.mode));
|
||||
|
||||
// Remove children
|
||||
tagsToggleBox.textContent = "";
|
||||
|
|
|
@ -168,14 +168,14 @@ Components.utils.import("resource://gre/modules/osfile.jsm");
|
|||
// Add a function to Zotero.Promise to check whether a value is still defined, and if not
|
||||
// to throw a specific error that's ignored by the unhandled rejection handler in
|
||||
// bluebird.js. This allows for easily cancelling promises when they're no longer
|
||||
// needed, for example after a view is destroyed.
|
||||
// needed, for example after a binding is destroyed.
|
||||
//
|
||||
// Example usage:
|
||||
//
|
||||
// getAsync.tap(() => Zotero.Promise.check(this.win))
|
||||
// getAsync.tap(() => Zotero.Promise.check(this.mode))
|
||||
//
|
||||
// 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.
|
||||
// If the binding is destroyed while getAsync() is being resolved and this.mode no longer
|
||||
// exists, subsequent lines won't be run, and nothing will be logged to the console.
|
||||
this.Promise.check = function (val) {
|
||||
if (!val && val !== 0) {
|
||||
let e = new Error;
|
||||
|
|
Loading…
Reference in New Issue
Block a user