summaryrefslogtreecommitdiff
path: root/ext/bg/js/backend.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-07 19:00:58 -0400
committerGitHub <noreply@github.com>2020-04-07 19:00:58 -0400
commitfa68a8773605ee0943e1c5e9766fa6bcfb6c6a42 (patch)
tree3ac714d3b485b1a1b6b349f48a91a67045256f81 /ext/bg/js/backend.js
parent3df78904cf734da208c6fd1b6ae1cd6612323148 (diff)
parent29cf8d2f79f23b7723d508085ca242396bbbd5c9 (diff)
Merge pull request #415 from toasted-nutbread/anki-marker-document-title
Anki marker document title
Diffstat (limited to 'ext/bg/js/backend.js')
-rw-r--r--ext/bg/js/backend.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 1e8c979f..d4c822ca 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -455,7 +455,7 @@ class Backend {
return results;
}
- async _onApiDefinitionAdd({definition, mode, context, optionsContext}) {
+ async _onApiDefinitionAdd({definition, mode, context, details, optionsContext}) {
const options = this.getOptions(optionsContext);
const templates = this.defaultAnkiFieldTemplates;
@@ -468,19 +468,19 @@ class Backend {
);
}
- if (context && context.screenshot) {
+ if (details && details.screenshot) {
await this._injectScreenshot(
definition,
options.anki.terms.fields,
- context.screenshot
+ details.screenshot
);
}
- const note = await this.ankiNoteBuilder.createNote(definition, mode, options, templates);
+ const note = await this.ankiNoteBuilder.createNote(definition, mode, context, options, templates);
return this.anki.addNote(note);
}
- async _onApiDefinitionsAddable({definitions, modes, optionsContext}) {
+ async _onApiDefinitionsAddable({definitions, modes, context, optionsContext}) {
const options = this.getOptions(optionsContext);
const templates = this.defaultAnkiFieldTemplates;
const states = [];
@@ -489,7 +489,7 @@ class Backend {
const notes = [];
for (const definition of definitions) {
for (const mode of modes) {
- const note = await this.ankiNoteBuilder.createNote(definition, mode, options, templates);
+ const note = await this.ankiNoteBuilder.createNote(definition, mode, context, options, templates);
notes.push(note);
}
}