Fix noteUsesScreenshot not checking mode
This commit is contained in:
parent
32cb1debb5
commit
fa385aafa4
@ -633,7 +633,7 @@ class Display {
|
|||||||
this.setSpinnerVisible(true);
|
this.setSpinnerVisible(true);
|
||||||
|
|
||||||
const context = {};
|
const context = {};
|
||||||
if (this.noteUsesScreenshot()) {
|
if (this.noteUsesScreenshot(mode)) {
|
||||||
const screenshot = await this.getScreenshot();
|
const screenshot = await this.getScreenshot();
|
||||||
if (screenshot) {
|
if (screenshot) {
|
||||||
context.screenshot = screenshot;
|
context.screenshot = screenshot;
|
||||||
@ -703,8 +703,9 @@ class Display {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
noteUsesScreenshot() {
|
noteUsesScreenshot(mode) {
|
||||||
const fields = this.options.anki.terms.fields;
|
const optionsAnki = this.options.anki;
|
||||||
|
const fields = (mode === 'kanji' ? optionsAnki.kanji : optionsAnki.terms).fields;
|
||||||
for (const fieldValue of Object.values(fields)) {
|
for (const fieldValue of Object.values(fields)) {
|
||||||
if (fieldValue.includes('{screenshot}')) {
|
if (fieldValue.includes('{screenshot}')) {
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user