From acaaf3f13e2f9dc5b34a182d32d18c5b6ab700c5 Mon Sep 17 00:00:00 2001 From: anpigon Date: Tue, 30 Aug 2022 20:26:42 +0900 Subject: [PATCH] fix: Error creating notes on mobile --- src/main.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.ts b/src/main.ts index 4210b96..7d4c10e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,4 +1,3 @@ -import * as path from 'path'; import { MarkdownView, Notice, Plugin } from 'obsidian'; import { BookSearchModal } from '@views/book_search_modal'; @@ -35,6 +34,8 @@ export default class BookSearchPlugin extends Plugin { // This adds a settings tab so the user can configure various aspects of the plugin this.addSettingTab(new BookSearchSettingTab(this.app, this)); + + console.log(`Book Search: version ${this.manifest.version} (requires obsidian ${this.manifest.minAppVersion})`); } showNotice(message: unknown) { @@ -118,7 +119,7 @@ export default class BookSearchPlugin extends Plugin { // TODO: If the same file exists, it asks if you want to overwrite it. // create new File const fileName = makeFileName(book, this.settings.fileNameFormat); - const filePath = path.join(this.settings.folder, fileName); + const filePath = `${this.settings.folder}/${fileName}`; const targetFile = await this.app.vault.create(filePath, renderedContents); await activeLeaf.openFile(targetFile, { state: { mode: 'source' } }); activeLeaf.setEphemeralState({ rename: 'all' }); @@ -126,7 +127,7 @@ export default class BookSearchPlugin extends Plugin { // cursor focus await new CursorJumper(this.app).jumpToNextCursorLocation(); } catch (err) { - // console.warn(err); + console.warn(err); this.showNotice(err); } }