Use for of
This commit is contained in:
parent
7b97138ad1
commit
b391704f3d
@ -156,8 +156,8 @@ function audioBuildFilename(definition) {
|
|||||||
|
|
||||||
async function audioInject(definition, fields, sources, optionsContext) {
|
async function audioInject(definition, fields, sources, optionsContext) {
|
||||||
let usesAudio = false;
|
let usesAudio = false;
|
||||||
for (const name in fields) {
|
for (const fieldValue of Object.values(fields)) {
|
||||||
if (fields[name].includes('{audio}')) {
|
if (fieldValue.includes('{audio}')) {
|
||||||
usesAudio = true;
|
usesAudio = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -719,8 +719,8 @@ class Backend {
|
|||||||
|
|
||||||
async _injectScreenshot(definition, fields, screenshot) {
|
async _injectScreenshot(definition, fields, screenshot) {
|
||||||
let usesScreenshot = false;
|
let usesScreenshot = false;
|
||||||
for (const name in fields) {
|
for (const fieldValue of Object.values(fields)) {
|
||||||
if (fields[name].includes('{screenshot}')) {
|
if (fieldValue.includes('{screenshot}')) {
|
||||||
usesScreenshot = true;
|
usesScreenshot = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -705,8 +705,8 @@ class Display {
|
|||||||
|
|
||||||
noteUsesScreenshot() {
|
noteUsesScreenshot() {
|
||||||
const fields = this.options.anki.terms.fields;
|
const fields = this.options.anki.terms.fields;
|
||||||
for (const name in fields) {
|
for (const fieldValue of Object.values(fields)) {
|
||||||
if (fields[name].includes('{screenshot}')) {
|
if (fieldValue.includes('{screenshot}')) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user