mirror of
https://github.com/Wanxp/obsidian-douban.git
synced 2026-04-05 01:28:46 +08:00
hotfix v1.5.1
This commit is contained in:
parent
44bc498994
commit
8eb87e85b0
6
main.ts
6
main.ts
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user