From 669d277a95908cec7b35e098b3252ae38db05df0 Mon Sep 17 00:00:00 2001 From: Kuuuube <61125188+Kuuuube@users.noreply.github.com> Date: Tue, 16 Apr 2024 12:25:59 -0400 Subject: Fix duplicate check not working across note types (#830) * Fix duplicate check not working across note types * Add invalidNoteId --------- Co-authored-by: James Maa --- ext/js/display/display-anki.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ext/js/display/display-anki.js') diff --git a/ext/js/display/display-anki.js b/ext/js/display/display-anki.js index fd3e8dcd..dc676702 100644 --- a/ext/js/display/display-anki.js +++ b/ext/js/display/display-anki.js @@ -21,7 +21,7 @@ import {log} from '../core/log.js'; import {toError} from '../core/to-error.js'; import {deferPromise} from '../core/utilities.js'; import {AnkiNoteBuilder} from '../data/anki-note-builder.js'; -import {isNoteDataValid} from '../data/anki-util.js'; +import {invalidNoteId, isNoteDataValid} from '../data/anki-util.js'; import {PopupMenu} from '../dom/popup-menu.js'; import {querySelectorNotNull} from '../dom/query-selector.js'; import {TemplateRendererProxy} from '../templates/template-renderer-proxy.js'; @@ -425,7 +425,11 @@ export class DisplayAnki { if (Array.isArray(noteIds) && noteIds.length > 0) { if (allNoteIds === null) { allNoteIds = new Set(); } - for (const noteId of noteIds) { allNoteIds.add(noteId); } + for (const noteId of noteIds) { + if (noteId !== invalidNoteId) { + allNoteIds.add(noteId); + } + } } if (displayTags !== 'never' && Array.isArray(noteInfos)) { -- cgit v1.2.3