diff options
author | Alex Yatskov <alex@foosoft.net> | 2017-10-29 10:42:39 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2017-10-29 10:42:39 -0700 |
commit | c62cc01642b29c13a38f3bcc08f2fa144107c158 (patch) | |
tree | 571bf3c63b405ebb9c69ca8f687f91e1950d14c4 /ext/bg/js/settings.js | |
parent | 7d29e5b533a4607d1580cb6982de3870605805af (diff) |
simplify database interface
Diffstat (limited to 'ext/bg/js/settings.js')
-rw-r--r-- | ext/bg/js/settings.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/bg/js/settings.js b/ext/bg/js/settings.js index d608a81b..9d47f33c 100644 --- a/ext/bg/js/settings.js +++ b/ext/bg/js/settings.js @@ -109,12 +109,12 @@ async function formMainDictionaryOptionsPopulate(options) { select.append($('<option class="text-muted" value="">Not selected</option>')); let mainDictionary = ''; - const formOptions = [$]; - const titles = await utilDatabaseGetTitlesWithSequences(); - for (const title of titles) { - select.append($(`<option value="${title}">${title}</option>`)); - if (title === options.general.mainDictionary) { - mainDictionary = title; + for (const dictRow of await utilDatabaseSummarize()) { + if (dictRow.hasSequences) { + select.append($(`<option value="${dictRow.title}">${dictRow.title}</option>`)); + if (dictRow.title === options.general.mainDictionary) { + mainDictionary = dictRow.title; + } } } @@ -271,7 +271,7 @@ async function dictionaryGroupsPopulate(options) { const dictGroups = $('#dict-groups').empty(); const dictWarning = $('#dict-warning').hide(); - const dictRows = await utilDatabaseGetTitles(); + const dictRows = await utilDatabaseSummarize(); if (dictRows.length === 0) { dictWarning.show(); } |