Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

fix: network modal button disabling #885

Merged
merged 2 commits into from Dec 30, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/renderer/components/Network/NetworkModal.vue
Expand Up @@ -178,7 +178,7 @@

<button
v-if="network && !network.isDefault"
:disabled="$v.form.$invalid || isNetworkInUse"
:disabled="isNetworkInUse"
class="blue-button mt-5 ml-4"
type="button"
@click="removeNetwork"
Expand Down Expand Up @@ -256,6 +256,7 @@ export default {
'Basic',
'Advanced'
],
originalName: null,
configChoice: 'Basic',
apiVersion: 2,
hasFetched: false,
Expand Down Expand Up @@ -336,6 +337,7 @@ export default {
// Set network values if one is passed along
if (this.network) {
this.form.name = this.network.title
this.originalName = this.network.title // To ensure that we allow the "duplicate" name as it's the same network
this.form.description = this.network.description
this.form.server = this.network.server

Expand Down Expand Up @@ -555,7 +557,7 @@ export default {
name: {
required,
doesNotExists (value) {
return !this.$store.getters['network/byName'](value)
return (this.originalName && value === this.originalName) || !this.$store.getters['network/byName'](value)
}
},
description: {
Expand Down