cleanup
This commit is contained in:
parent
ba155e7706
commit
fea35435b2
@ -58,7 +58,7 @@ class AnkiConnect {
|
|||||||
if (this.remoteVersion < this.localVersion) {
|
if (this.remoteVersion < this.localVersion) {
|
||||||
this.remoteVersion = await this.ankiInvoke('version');
|
this.remoteVersion = await this.ankiInvoke('version');
|
||||||
if (this.remoteVersion < this.localVersion) {
|
if (this.remoteVersion < this.localVersion) {
|
||||||
return Promise.reject('extension and plugin versions incompatible');
|
throw 'extension and plugin versions incompatible';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,8 +84,9 @@ function utilCommandDispatch(command) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
toggle: () => {
|
toggle: () => {
|
||||||
this.options.general.enable = !this.options.general.enable;
|
const options = chrome.extension.getBackgroundPage().yomichan.options;
|
||||||
optionsSave(this.options).then(() => this.optionsSet(this.options));
|
options.general.enable = !options.general.enable;
|
||||||
|
optionsSave(options).then(() => apiOptionsSet(options));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -96,8 +97,7 @@ function utilCommandDispatch(command) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function utilNoteFormat(definition, mode) {
|
function utilNoteFormat(definition, mode) {
|
||||||
const yomichan = chrome.extension.getBackgroundPage().yomichan;
|
const options = chrome.extension.getBackgroundPage().yomichan.options;
|
||||||
const options = yomichan.options;
|
|
||||||
const note = {fields: {}, tags: options.anki.tags};
|
const note = {fields: {}, tags: options.anki.tags};
|
||||||
let fields = [];
|
let fields = [];
|
||||||
|
|
||||||
@ -174,8 +174,7 @@ async function apiOptionsSet(options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function apiOptionsGet() {
|
async function apiOptionsGet() {
|
||||||
const yomichan = chrome.extension.getBackgroundPage().yomichan;
|
return chrome.extension.getBackgroundPage().yomichan.options;
|
||||||
return yomichan.options;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function apiTermsFind(text) {
|
async function apiTermsFind(text) {
|
||||||
|
Loading…
Reference in New Issue
Block a user