aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js/display.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-02-25 22:24:22 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-02-25 22:24:22 -0500
commitfa385aafa4cf1b0101b6bc0a08f38b8508666158 (patch)
tree59f987bd31f38d2f57f34ceeac5950f3936c819b /ext/mixed/js/display.js
parent32cb1debb52624eb458b1fa19fc10325b386605a (diff)
Fix noteUsesScreenshot not checking mode
Diffstat (limited to 'ext/mixed/js/display.js')
-rw-r--r--ext/mixed/js/display.js7
1 files changed, 4 insertions, 3 deletions
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;