Rename context to details
This commit is contained in:
parent
3df78904cf
commit
8b07a23de9
@ -455,7 +455,7 @@ class Backend {
|
||||
return results;
|
||||
}
|
||||
|
||||
async _onApiDefinitionAdd({definition, mode, context, optionsContext}) {
|
||||
async _onApiDefinitionAdd({definition, mode, details, optionsContext}) {
|
||||
const options = this.getOptions(optionsContext);
|
||||
const templates = this.defaultAnkiFieldTemplates;
|
||||
|
||||
@ -468,11 +468,11 @@ class Backend {
|
||||
);
|
||||
}
|
||||
|
||||
if (context && context.screenshot) {
|
||||
if (details && details.screenshot) {
|
||||
await this._injectScreenshot(
|
||||
definition,
|
||||
options.anki.terms.fields,
|
||||
context.screenshot
|
||||
details.screenshot
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -53,8 +53,8 @@ function apiKanjiFind(text, optionsContext) {
|
||||
return _apiInvoke('kanjiFind', {text, optionsContext});
|
||||
}
|
||||
|
||||
function apiDefinitionAdd(definition, mode, context, optionsContext) {
|
||||
return _apiInvoke('definitionAdd', {definition, mode, context, optionsContext});
|
||||
function apiDefinitionAdd(definition, mode, details, optionsContext) {
|
||||
return _apiInvoke('definitionAdd', {definition, mode, details, optionsContext});
|
||||
}
|
||||
|
||||
function apiDefinitionsAddable(definitions, modes, optionsContext) {
|
||||
|
@ -752,15 +752,15 @@ class Display {
|
||||
try {
|
||||
this.setSpinnerVisible(true);
|
||||
|
||||
const context = {};
|
||||
const details = {};
|
||||
if (this.noteUsesScreenshot(mode)) {
|
||||
const screenshot = await this.getScreenshot();
|
||||
if (screenshot) {
|
||||
context.screenshot = screenshot;
|
||||
details.screenshot = screenshot;
|
||||
}
|
||||
}
|
||||
|
||||
const noteId = await apiDefinitionAdd(definition, mode, context, this.getOptionsContext());
|
||||
const noteId = await apiDefinitionAdd(definition, mode, details, this.getOptionsContext());
|
||||
if (noteId) {
|
||||
const index = this.definitions.indexOf(definition);
|
||||
const adderButton = this.adderButtonFind(index, mode);
|
||||
|
Loading…
Reference in New Issue
Block a user