summaryrefslogtreecommitdiff
path: root/ext/js/background/backend.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/background/backend.js')
-rw-r--r--ext/js/background/backend.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/js/background/backend.js b/ext/js/background/backend.js
index 323219a4..f04006bc 100644
--- a/ext/js/background/backend.js
+++ b/ext/js/background/backend.js
@@ -17,6 +17,7 @@
/* global
* AnkiConnect
+ * AnkiUtil
* AudioDownloader
* ClipboardMonitor
* ClipboardReader
@@ -456,10 +457,12 @@ class Backend {
for (let i = 0; i < notes.length; ++i) {
const note = notes[i];
- const canAdd = canAddArray[i];
- const info = {canAdd, noteIds: null};
+ let canAdd = canAddArray[i];
+ const valid = AnkiUtil.isNoteDataValid(note);
+ if (!valid) { canAdd = false; }
+ const info = {canAdd, valid, noteIds: null};
results.push(info);
- if (!canAdd) {
+ if (!canAdd && valid) {
cannotAdd.push({note, info});
}
}