Rename context to details

This commit is contained in:
toasted-nutbread 2020-03-15 17:02:34 -04:00
parent 3df78904cf
commit 8b07a23de9
3 changed files with 8 additions and 8 deletions

View File

@ -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
);
}

View File

@ -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) {

View File

@ -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);