diff options
Diffstat (limited to 'ext/bg/js/database.js')
-rw-r--r-- | ext/bg/js/database.js | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/ext/bg/js/database.js b/ext/bg/js/database.js index 0de0505d..7a893fc0 100644 --- a/ext/bg/js/database.js +++ b/ext/bg/js/database.js @@ -85,25 +85,26 @@ class Database { return results; } - async findTermsBySequence(sequence, dictionary) { + async findTermsBySequence(sequence, mainDictionary) { if (!this.db) { throw 'Database not initialized'; } const results = []; await this.db.terms.where('sequence').equals(sequence).each(row => { - // if (dictionary === row.dictionary) { - results.push({ - expression: row.expression, - reading: row.reading, - tags: dictFieldSplit(row.tags), - rules: dictFieldSplit(row.rules), - glossary: row.glossary, - score: row.score, - dictionary: row.dictionary, - id: row.id, - sequence: typeof row.sequence === 'undefined' ? -1 : row.sequence - }); + if (row.dictionary === mainDictionary) { + results.push({ + expression: row.expression, + reading: row.reading, + tags: dictFieldSplit(row.tags), + rules: dictFieldSplit(row.rules), + glossary: row.glossary, + score: row.score, + dictionary: row.dictionary, + id: row.id, + sequence: typeof row.sequence === 'undefined' ? -1 : row.sequence + }); + } }); return results; |