From 44d7ad5a8ba612c1d704383f871967f1915235f3 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sun, 5 Mar 2017 16:27:29 -0800 Subject: firefox fixes --- ext/bg/js/options.js | 2 +- ext/bg/js/util.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'ext') diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js index 4a7b88c1..dee7e379 100644 --- a/ext/bg/js/options.js +++ b/ext/bg/js/options.js @@ -192,7 +192,7 @@ function dictionaryGroupsPopulate(options) { } for (const row of dictRowsSort(rows, options)) { - const dictOptions = options.dictionaries[row.title]; + const dictOptions = options.dictionaries[row.title] || {enabled: false, priority: 0}; const dictHtml = handlebarsRender('dictionary.html', { title: row.title, version: row.version, diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js index e847090f..7f031040 100644 --- a/ext/bg/js/util.js +++ b/ext/bg/js/util.js @@ -251,8 +251,8 @@ function dictEnabled(options) { function dictRowsSort(rows, options) { return rows.sort((ra, rb) => { - const pa = options.dictionaries[ra.title].priority || 0; - const pb = options.dictionaries[rb.title].priority || 0; + const pa = (options.dictionaries[ra.title] || {}).priority || 0; + const pb = (options.dictionaries[rb.title] || {}).priority || 0; if (pa > pb) { return -1; } else if (pa < pb) { -- cgit v1.2.3