hotfix v1.5.1

This commit is contained in:
wanxp 2022-10-31 01:22:52 +08:00
parent 44bc498994
commit 8eb87e85b0
4 changed files with 6 additions and 5 deletions

@ -50,7 +50,6 @@ export default class DoubanPlugin extends Plugin {
}
async getDoubanTextForActiveFile(editor: Editor) {
this.doubanStatusBar = this.addStatusBarItem();
const activeFile = await this.app.workspace.getActiveFile();
if (activeFile) {
const searchTerm = activeFile.basename;
@ -67,7 +66,9 @@ export default class DoubanPlugin extends Plugin {
async onload() {
await this.loadSettings();
this.addCommand({
this.doubanStatusBar = this.addStatusBarItem();
this.addCommand({
id: "search-douban-by-current-file-name",
name: i18nHelper.getMessage("110001"),
editorCallback: (editor: Editor) =>
@ -102,6 +103,7 @@ export default class DoubanPlugin extends Plugin {
}
showStatus(origin:string, message:string) {
this.doubanStatusBar.empty();
// @ts-ignore
this.doubanStatusBar.setText(i18nHelper.getMessage(origin).replace('{0}', message));

@ -114,7 +114,7 @@ export default abstract class DoubanAbstractLoadHandler<T extends DoubanSubject>
.then(this.parseSubjectFromHtml)
.then(content => this.toEditor(editor, content))
// .then(content => content ? editor.replaceSelection(content) : content)
.catch(log.error(i18nHelper.getMessage('130101')))
.catch(e => log.error(i18nHelper.getMessage('130101')))
;
}

@ -53,7 +53,6 @@ export class DoubanSearchModal extends Modal {
async onClose() {
let {contentEl} = this;
contentEl.empty();
if (this.searchTerm) {
await this.plugin.search(this.searchTerm, this.editor);

@ -14,7 +14,7 @@ class Logger {
}
public info(e: any): any {
console.log(`Douban Plugin info:` + `${typeof e == 'string' ? e : JSON.stringify(e)}`);
// console.log(`Douban Plugin info:` + `${typeof e == 'string' ? e : JSON.stringify(e)}`);
return e;
}