From bd9c53b29c7ad7d47644c79d732a2a8a2ad339c0 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 24 May 2015 17:39:27 -0400 Subject: [PATCH] Fix tag selector loading (broken by 6b87c641) --- chrome/content/zotero/bindings/tagselector.xml | 4 ++-- chrome/content/zotero/xpcom/zotero.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/chrome/content/zotero/bindings/tagselector.xml b/chrome/content/zotero/bindings/tagselector.xml index 9dbb5db62..09cde1350 100644 --- a/chrome/content/zotero/bindings/tagselector.xml +++ b/chrome/content/zotero/bindings/tagselector.xml @@ -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 = ""; diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 231705971..b80980418 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -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;