From afecbcdcd072caf6820bafee27da05777a4fa8a9 Mon Sep 17 00:00:00 2001 From: Wanxp <977741432@qq.com> Date: Tue, 3 Jan 2023 11:55:18 +0800 Subject: [PATCH] fix search and create file but open in leftLeaf --- manifest.json | 2 +- package.json | 2 +- src/org/wanxp/file/FileHandler.ts | 2 +- versions.json | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/manifest.json b/manifest.json index 42fe98e..3dc5eaa 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-douban-plugin", "name": "Douban", - "version": "1.7.9", + "version": "1.8.0", "minAppVersion": "0.12.0", "description": "This is a plugin that can import movies/books/musics/notes/games info data from Douban for Obsidian .", "author": "Wanxp", diff --git a/package.json b/package.json index def8c98..a205460 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-douban-plugin", - "version": "1.7.9", + "version": "1.8.0", "description": "This is a plugin for Obsidian (https://obsidian.md) that can import data from Douban (https://www.douban.com/).", "main": "main.js", "scripts": { diff --git a/src/org/wanxp/file/FileHandler.ts b/src/org/wanxp/file/FileHandler.ts index 4a61813..d2ba3fc 100644 --- a/src/org/wanxp/file/FileHandler.ts +++ b/src/org/wanxp/file/FileHandler.ts @@ -136,7 +136,7 @@ export default class FileHandler { const File = await vault.create(filePath, data); // Create the file and open it in the active leaf if (showAfterCreate) { - const leaf = this._app.workspace.getRightLeaf(true); + const leaf = this._app.workspace.getLeaf(true); await leaf.openFile(File); } return true; diff --git a/versions.json b/versions.json index 5c6a330..4442612 100644 --- a/versions.json +++ b/versions.json @@ -24,5 +24,6 @@ "1.7.6": "0.12.0", "1.7.7": "0.12.0", "1.7.8": "0.12.0", - "1.7.9": "0.12.0" + "1.7.9": "0.12.0", + "1.8.0": "0.12.0" }