From 6ece7b12be582b97d82ae56dea73d29ae6bade11 Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Fri, 26 Jun 2020 11:34:36 +0800 Subject: [PATCH] feat(webui): allow direct input of library path in add dialog closes #88 --- komga-webui/src/components/FileBrowserDialog.vue | 12 +++++++++--- komga-webui/src/components/LibraryAddDialog.vue | 3 +-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/komga-webui/src/components/FileBrowserDialog.vue b/komga-webui/src/components/FileBrowserDialog.vue index cce942a23..44ca2ec66 100644 --- a/komga-webui/src/components/FileBrowserDialog.vue +++ b/komga-webui/src/components/FileBrowserDialog.vue @@ -79,6 +79,7 @@ export default Vue.extend({ }, watch: { value (val) { + if (val) this.dialogInit() this.modalFileBrowser = val }, modalFileBrowser (val) { @@ -100,10 +101,15 @@ export default Vue.extend({ default: 'Choose', }, }, - async mounted () { - this.getDirs() - }, methods: { + dialogInit () { + try { + this.getDirs(this.path) + this.selectedPath = this.path + } catch (e) { + this.getDirs() + } + }, dialogCancel () { this.$emit('input', false) }, diff --git a/komga-webui/src/components/LibraryAddDialog.vue b/komga-webui/src/components/LibraryAddDialog.vue index 0952e1b13..2faac1cdc 100644 --- a/komga-webui/src/components/LibraryAddDialog.vue +++ b/komga-webui/src/components/LibraryAddDialog.vue @@ -45,7 +45,6 @@