Skip to content

Commit

Permalink
fixed typescript error
Browse files Browse the repository at this point in the history
  • Loading branch information
Paz committed Jan 4, 2025
1 parent b74f386 commit e21d893
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions frontend/src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ async function updateFromRoutePath() {
selectedNote.value = await noteRepository.getByPath(path.join("/"))
} catch (e) {
console.log(`${e}`)
errorMessage.value = e.message
errorDialog.value?.showModal()
if (e instanceof Error) {
errorMessage.value = e.message
errorDialog.value?.showModal()
}
return
}
console.log("updating note with note", selectedNote.value)
Expand All @@ -85,12 +87,18 @@ async function updateFromRoutePath() {
directoryContent.value = await directoryContentRepository.getByPath(currentDirectory.value)
} catch (e) {
console.log(`${e}`)
errorMessage.value = e.message
errorDialog.value?.showModal()
if (e instanceof Error) {
errorMessage.value = e.message
errorDialog.value?.showModal()
}
return
}
}
function closeErrorDialog() {
errorMessage.value = ""
errorDialog.value?.close()
}
onMounted(async () => {
updateFromRoutePath()
Expand Down Expand Up @@ -148,7 +156,7 @@ function showSidebar() {
<dialog ref="errorDialog" id="error-dialog">
<header>
<h1>Error</h1>
<button @click="errorDialog?.close()" class="btn-primary">
<button @click="closeErrorDialog()" class="btn-primary">
<SquareXIcon />
</button>
</header>
Expand Down

0 comments on commit e21d893

Please sign in to comment.