summaryrefslogtreecommitdiff
path: root/ext/bg/js/api.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-09-06 13:35:18 -0700
committerAlex Yatskov <alex@foosoft.net>2017-09-06 13:35:18 -0700
commit9efe7bfe1b904db43fafda3520d702c17f44b362 (patch)
tree696d1d3de9bc968e9801c10a220c3e2819024d94 /ext/bg/js/api.js
parenta3c8508031a1073629803d0616a2ee416cd3cccc (diff)
work on sandbox
Diffstat (limited to 'ext/bg/js/api.js')
-rw-r--r--ext/bg/js/api.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js
index 0aad436a..5a307df3 100644
--- a/ext/bg/js/api.js
+++ b/ext/bg/js/api.js
@@ -62,7 +62,8 @@ async function apiDefinitionAdd(definition, mode) {
);
}
- return utilBackend().anki.addNote(dictNoteFormat(definition, mode, options));
+ const note = await dictNoteFormat(definition, mode, options);
+ return utilBackend().anki.addNote(note);
}
async function apiDefinitionsAddable(definitions, modes) {
@@ -72,7 +73,8 @@ async function apiDefinitionsAddable(definitions, modes) {
const notes = [];
for (const definition of definitions) {
for (const mode of modes) {
- notes.push(dictNoteFormat(definition, mode, utilBackend().options));
+ const note = await dictNoteFormat(definition, mode, utilBackend().options);
+ notes.push(note);
}
}