From dc9526beb34496cd34a84d4bf826b5b6533b7ed2 Mon Sep 17 00:00:00 2001 From: advplyr Date: Tue, 19 Jul 2022 17:32:49 -0500 Subject: [PATCH] Fix:Edit server config showing duplicate config already exists --- components/connection/ServerConnectForm.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/connection/ServerConnectForm.vue b/components/connection/ServerConnectForm.vue index a5ad3d4e..4ef943f9 100644 --- a/components/connection/ServerConnectForm.vue +++ b/components/connection/ServerConnectForm.vue @@ -16,6 +16,9 @@
+
+ arrow_back +

Server address

@@ -273,7 +276,8 @@ export default { this.error = 'Invalid username' return } - const duplicateConfig = this.serverConnectionConfigs.find((scc) => scc.address === this.serverConfig.address && scc.username === this.serverConfig.username) + + const duplicateConfig = this.serverConnectionConfigs.find((scc) => scc.address === this.serverConfig.address && scc.username === this.serverConfig.username && this.serverConfig.id !== scc.id) if (duplicateConfig) { this.error = 'Config already exists for this address and username' return @@ -293,7 +297,7 @@ export default { console.log('Successfully logged in', JSON.stringify(user)) - this.$store.commit('setServerSettings', data.serverSettings) + this.$store.commit('setServerSettings', serverSettings) // Set library - Use last library if set and available fallback to default user library var lastLibraryId = await this.$localStore.getLastLibraryId()