From 3829f12603bee2d8b99f3a78caa3d6e502f27f16 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 30 Mar 2019 10:35:03 -0400 Subject: [PATCH] Speed up renaming of colored tags --- chrome/content/zotero/xpcom/data/tags.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/tags.js b/chrome/content/zotero/xpcom/data/tags.js index 4fd19186f2..9969e66fd8 100644 --- a/chrome/content/zotero/xpcom/data/tags.js +++ b/chrome/content/zotero/xpcom/data/tags.js @@ -290,16 +290,18 @@ Zotero.Tags = new function() { }.bind(this)); if (oldColorData) { - // Remove color from old tag - yield this.setColor(libraryID, oldName); - - // Add color to new tag - yield this.setColor( - libraryID, - newName, - oldColorData.color, - oldColorData.position - ); + yield Zotero.DB.executeTransaction(function* () { + // Remove color from old tag + yield this.setColor(libraryID, oldName); + + // Add color to new tag + yield this.setColor( + libraryID, + newName, + oldColorData.color, + oldColorData.position + ); + }.bind(this)); } });