aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-12-17 23:38:14 -0800
committerAlex Yatskov <alex@foosoft.net>2016-12-17 23:38:14 -0800
commite5275560cecc839930c4fdad52dc96df512212e1 (patch)
treedffdbcc6a819ab6c2743cd63f07d010dbd7c409e /ext/bg/js
parentd44f0c576428b69e3deae42893af66371696425b (diff)
Fixes
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/database.js6
-rw-r--r--ext/bg/js/translator.js2
2 files changed, 6 insertions, 2 deletions
diff --git a/ext/bg/js/database.js b/ext/bg/js/database.js
index 1bcceb05..e596dbad 100644
--- a/ext/bg/js/database.js
+++ b/ext/bg/js/database.js
@@ -47,6 +47,7 @@ class Database {
this.db.close();
return this.db.delete().then(() => {
this.db = null;
+ this.tagMetaCache = {};
this.prepare();
});
}
@@ -93,6 +94,7 @@ class Database {
onyomi: splitField(row.onyomi),
kunyomi: splitField(row.kunyomi),
tags: splitField(row.tags),
+ dictionary: row.dictionary,
glossary: row.meanings
});
}
@@ -214,6 +216,8 @@ class Database {
return this.db.tagMeta.where('dictionary').equals(title).delete();
}).then(() => {
return this.db.dictionaries.where('title').equals(title).delete();
+ }).then(() => {
+ delete this.cacheTagMeta[title];
});
}
@@ -238,7 +242,7 @@ class Database {
name: tag,
category: meta.category || 'default',
notes: meta.notes || '',
- order: meta.order || Number.MAX_SAFE_INTEGER,
+ order: meta.order || 0,
dictionary: title
});
}
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index 73853612..7d19b5f9 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -154,7 +154,7 @@ class Translator {
processKanji(definitions) {
for (const definition of definitions) {
- const tags = definitions.tags.map(tag => buildTag(tag, definition.tagMeta));
+ const tags = definition.tags.map(tag => buildTag(tag, definition.tagMeta));
definition.tags = sortTags(tags);
}