From fa385aafa4cf1b0101b6bc0a08f38b8508666158 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Tue, 25 Feb 2020 22:24:22 -0500 Subject: Fix noteUsesScreenshot not checking mode --- ext/mixed/js/display.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ext') diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js index b0bcff7c..8a68b43f 100644 --- a/ext/mixed/js/display.js +++ b/ext/mixed/js/display.js @@ -633,7 +633,7 @@ class Display { this.setSpinnerVisible(true); const context = {}; - if (this.noteUsesScreenshot()) { + if (this.noteUsesScreenshot(mode)) { const screenshot = await this.getScreenshot(); if (screenshot) { context.screenshot = screenshot; @@ -703,8 +703,9 @@ class Display { } } - noteUsesScreenshot() { - const fields = this.options.anki.terms.fields; + noteUsesScreenshot(mode) { + const optionsAnki = this.options.anki; + const fields = (mode === 'kanji' ? optionsAnki.kanji : optionsAnki.terms).fields; for (const fieldValue of Object.values(fields)) { if (fieldValue.includes('{screenshot}')) { return true; -- cgit v1.2.3