Dexie fixes
This commit is contained in:
parent
ed2091ae1b
commit
8c22f53f3e
@ -20,7 +20,7 @@
|
|||||||
class Dictionary {
|
class Dictionary {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.db = null;
|
this.db = null;
|
||||||
this.dbVer = 5;
|
this.dbVer = 6;
|
||||||
this.entities = null;
|
this.entities = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,13 +144,11 @@ class Dictionary {
|
|||||||
return Promise.reject('database not initialized');
|
return Promise.reject('database not initialized');
|
||||||
}
|
}
|
||||||
|
|
||||||
const tasks = [
|
return this.db.terms.where('dictionary').equals(title).delete().then(() => {
|
||||||
this.db.terms.where('dictionary').equals(title).delete(),
|
return this.db.kanji.where('dictionary').equals(title).delete();
|
||||||
this.db.kanji.where('dictionary').equals(title).delete(),
|
}).then(() => {
|
||||||
this.db.entities.where('dictionary').equals(title).delete()
|
return this.db.entities.where('dictionary').equals(title).delete();
|
||||||
];
|
}).then(() => {
|
||||||
|
|
||||||
return Promise.all(tasks).then(() => {
|
|
||||||
return this.db.dictionaries.where('title').equals(title).delete();
|
return this.db.dictionaries.where('title').equals(title).delete();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -181,11 +181,11 @@ function populateDictionaries(opts) {
|
|||||||
container.append($(html));
|
container.append($(html));
|
||||||
});
|
});
|
||||||
|
|
||||||
const dictDelete = $('.dict-delete');
|
$('.dict-delete').click(e => {
|
||||||
dictDelete.click(() => {
|
const dict = $(e.target).closest('.dict');
|
||||||
const dict = dictDelete.closest('.dict');
|
|
||||||
const title = dict.data('title');
|
const title = dict.data('title');
|
||||||
yomichan().translator.dictionary.deleteDictionary(title).then(() => dict.slideUp());
|
yomichan().translator.dictionary.deleteDictionary(title);
|
||||||
|
dict.slideUp();
|
||||||
});
|
});
|
||||||
|
|
||||||
container.find('.dict input').change(onOptionsChanged);
|
container.find('.dict input').change(onOptionsChanged);
|
||||||
|
5
ext/lib/dexie.min.js
vendored
5
ext/lib/dexie.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user