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) {
|
||||
let usesAudio = false;
|
||||
for (const name in fields) {
|
||||
if (fields[name].includes('{audio}')) {
|
||||
for (const fieldValue of Object.values(fields)) {
|
||||
if (fieldValue.includes('{audio}')) {
|
||||
usesAudio = true;
|
||||
break;
|
||||
}
|
||||
|
@ -719,8 +719,8 @@ class Backend {
|
||||
|
||||
async _injectScreenshot(definition, fields, screenshot) {
|
||||
let usesScreenshot = false;
|
||||
for (const name in fields) {
|
||||
if (fields[name].includes('{screenshot}')) {
|
||||
for (const fieldValue of Object.values(fields)) {
|
||||
if (fieldValue.includes('{screenshot}')) {
|
||||
usesScreenshot = true;
|
||||
break;
|
||||
}
|
||||
|
@ -705,8 +705,8 @@ class Display {
|
||||
|
||||
noteUsesScreenshot() {
|
||||
const fields = this.options.anki.terms.fields;
|
||||
for (const name in fields) {
|
||||
if (fields[name].includes('{screenshot}')) {
|
||||
for (const fieldValue of Object.values(fields)) {
|
||||
if (fieldValue.includes('{screenshot}')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user