Fix repeated note IDs shown on the "View Note" button (#1927)
This commit is contained in:
parent
0331374241
commit
eb457caea9
@ -255,7 +255,7 @@ class DisplayAnki {
|
|||||||
const displayTags = this._displayTags;
|
const displayTags = this._displayTags;
|
||||||
const dictionaryEntryDetails = this._dictionaryEntryDetails;
|
const dictionaryEntryDetails = this._dictionaryEntryDetails;
|
||||||
for (let i = 0, ii = dictionaryEntryDetails.length; i < ii; ++i) {
|
for (let i = 0, ii = dictionaryEntryDetails.length; i < ii; ++i) {
|
||||||
const allNoteIds = [];
|
let allNoteIds = null;
|
||||||
for (const {mode, canAdd, noteIds, noteInfos, ankiError} of dictionaryEntryDetails[i].modeMap.values()) {
|
for (const {mode, canAdd, noteIds, noteInfos, ankiError} of dictionaryEntryDetails[i].modeMap.values()) {
|
||||||
const button = this._adderButtonFind(i, mode);
|
const button = this._adderButtonFind(i, mode);
|
||||||
if (button !== null) {
|
if (button !== null) {
|
||||||
@ -264,14 +264,15 @@ class DisplayAnki {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Array.isArray(noteIds) && noteIds.length > 0) {
|
if (Array.isArray(noteIds) && noteIds.length > 0) {
|
||||||
allNoteIds.push(...noteIds);
|
if (allNoteIds === null) { allNoteIds = new Set(); }
|
||||||
|
for (const noteId of noteIds) { allNoteIds.add(noteId); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (displayTags !== 'never' && Array.isArray(noteInfos)) {
|
if (displayTags !== 'never' && Array.isArray(noteInfos)) {
|
||||||
this._setupTagsIndicator(i, noteInfos);
|
this._setupTagsIndicator(i, noteInfos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this._updateViewNoteButton(i, allNoteIds, false);
|
this._updateViewNoteButton(i, allNoteIds !== null ? [...allNoteIds] : [], false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user