diff options
Diffstat (limited to 'ext/js/background')
-rw-r--r-- | ext/js/background/backend.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/js/background/backend.js b/ext/js/background/backend.js index deaef4a0..df0378b3 100644 --- a/ext/js/background/backend.js +++ b/ext/js/background/backend.js @@ -28,7 +28,7 @@ import {logErrorLevelToNumber} from '../core/log-utilities.js'; import {log} from '../core/log.js'; import {isObjectNotArray} from '../core/object-utilities.js'; import {clone, deferPromise, promiseTimeout} from '../core/utilities.js'; -import {isNoteDataValid} from '../data/anki-util.js'; +import {invalidNoteId, isNoteDataValid} from '../data/anki-util.js'; import {arrayBufferToBase64} from '../data/array-buffer-util.js'; import {OptionsUtil} from '../data/options-util.js'; import {getAllPermissions, hasPermissions, hasRequiredPermissionsForOptions} from '../data/permissions-util.js'; @@ -595,6 +595,10 @@ export class Backend { const valid = isNoteDataValid(note); + if (isDuplicate && duplicateNoteIds[originalIndices.indexOf(i)].length === 0) { + duplicateNoteIds[originalIndices.indexOf(i)] = [invalidNoteId]; + } + const noteIds = isDuplicate ? duplicateNoteIds[originalIndices.indexOf(i)] : null; const noteInfos = (fetchAdditionalInfo && noteIds !== null && noteIds.length > 0) ? await this._anki.notesInfo(noteIds) : []; |