Use for of

This commit is contained in:
toasted-nutbread 2020-02-25 21:58:12 -05:00
parent 7b97138ad1
commit b391704f3d
3 changed files with 6 additions and 6 deletions

View File

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

View File

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

View File

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