This commit is contained in:
Simon Cambier
2022-05-21 18:59:15 +02:00
parent f4b4b806ee
commit eb32b0af24
2 changed files with 9 additions and 2 deletions

View File

@@ -3,7 +3,7 @@ let lastSearch = ""
</script>
<script lang="ts">
import { TFile } from "obsidian"
import { Notice, TFile } from "obsidian"
import { onMount, tick } from "svelte"
import InputSearch from "./InputSearch.svelte"
import ModalContainer from "./ModalContainer.svelte"
@@ -67,7 +67,13 @@ function onInputCtrlEnter(): void {
}
async function onInputShiftEnter(): Promise<void> {
await createNote(searchQuery)
try {
await createNote(searchQuery)
}
catch(e) {
new Notice((e as Error).message)
return
}
modal.close()
}

View File

@@ -61,6 +61,7 @@ export async function createNote(name: string): Promise<void> {
}
catch (e) {
console.error(e)
throw e
}
}