Clarify debug lines for tag selector updating
This commit is contained in:
parent
b2d5b9a2f3
commit
67febb2f45
2 changed files with 5 additions and 2 deletions
|
@ -30,9 +30,11 @@ Zotero.TagSelector = class TagSelectorContainer extends React.Component {
|
|||
this.selectedTags = new Set();
|
||||
this.state = defaults;
|
||||
}
|
||||
|
||||
|
||||
// Update trigger #1 (triggered by ZoteroPane)
|
||||
async onItemViewChanged({collectionTreeRow, libraryID, tagsInScope}) {
|
||||
Zotero.debug('Updating tag selector from current view');
|
||||
|
||||
this.collectionTreeRow = collectionTreeRow || this.collectionTreeRow;
|
||||
|
||||
let newState = {loaded: true};
|
||||
|
@ -51,6 +53,7 @@ Zotero.TagSelector = class TagSelectorContainer extends React.Component {
|
|||
async notify(event, type, ids, extraData) {
|
||||
if (type === 'setting') {
|
||||
if (ids.some(val => val.split('/')[1] == 'tagColors')) {
|
||||
Zotero.debug("Updating tag selector after tag color change");
|
||||
let tagColors = Zotero.Tags.getColors(this.libraryID);
|
||||
this.state.tagColors = tagColors;
|
||||
this.setState({tagColors, tags: await this.getTags(null, tagColors)});
|
||||
|
@ -93,6 +96,7 @@ Zotero.TagSelector = class TagSelectorContainer extends React.Component {
|
|||
|
||||
// TODO: Check libraryID for some events to avoid refreshing unnecessarily on sync changes?
|
||||
|
||||
Zotero.debug("Updating tag selector after tag change");
|
||||
var newTags = await this.getTags();
|
||||
|
||||
if (type == 'item-tag' && event == 'remove') {
|
||||
|
|
|
@ -1156,7 +1156,6 @@ var ZoteroPane = new function()
|
|||
this.setTagScope = async function () {
|
||||
var collectionTreeRow = self.getCollectionTreeRow();
|
||||
if (self.tagSelectorShown()) {
|
||||
Zotero.debug('Updating tag selector with current tags');
|
||||
if (collectionTreeRow.editable) {
|
||||
ZoteroPane_Local.tagSelector.setMode('edit');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue