Skip to content

Commit

Permalink
fix: save path on category #481
Browse files Browse the repository at this point in the history
  • Loading branch information
WDaan committed Nov 15, 2022
1 parent e2dcb8e commit 954560e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/Modals/AddModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export default {
},
savepath() {
let savePath = this.getSettings().save_path
if (this.category) {
if (this.category && this.category.savePath) {
savePath = this.category.savePath
}
Expand Down
13 changes: 9 additions & 4 deletions src/components/Modals/TagsAndCategories/CreateCategoryDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</v-toolbar-title>
</v-card-title>
<v-card-text>
<v-form ref="categoryForm" class="px-6 mt-3">
<v-form ref="categoryForm" v-model="valid" lazy-validation class="px-6 mt-3">
<v-container>
<v-text-field v-model="category.name" :rules="nameRules" :counter="15" :label="$t('modals.newCategory.categoryName')" required :disabled="hasInitialCategory" />
<v-text-field v-model="category.savePath" :rules="PathRules" :counter="40" :label="$t('path')" required />
Expand All @@ -16,10 +16,10 @@
</v-card-text>
<v-divider />
<v-card-actions class="justify-end">
<v-btn v-if="!hasInitialCategory" class="accent white--text elevation-0 px-4" @click="create">
<v-btn v-if="!hasInitialCategory" class="accent white--text elevation-0 px-4" @click="create" :disabled="!valid">
{{ $t('create') }}
</v-btn>
<v-btn v-else class="accent white--text elevation-0 px-4" @click="edit">
<v-btn v-else class="accent white--text elevation-0 px-4" @click="edit" :disabled="!valid">
{{ $t('edit') }}
</v-btn>
<v-btn class="error white--text elevation-0 px-4" @click="cancel">
Expand Down Expand Up @@ -47,7 +47,8 @@ export default {
category: { name: '', savePath: '' },
mdiCancel,
mdiTagPlus,
mdiPencil
mdiPencil,
valid: true
}),
computed: {
...mapGetters(['getSelectedCategory']),
Expand All @@ -69,6 +70,10 @@ export default {
},
methods: {
create() {
this.$refs.categoryForm.validate()
return
qbit.createCategory(this.category)
this.cancel()
},
Expand Down

0 comments on commit 954560e

Please sign in to comment.