Fix a bug with splice

7c4d8b8d7aa560e7ed158ec3904aaaccb3e08c0e

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +2 -1Ignore whitespace
public/scripts/extensions/connection-manager/index.js+2 -1
@@ -241,7 +241,8 @@ async function createConnectionProfile(forceName = null) {
241 if (excludeState) {241 if (excludeState) {
242 profile.exclude.push(keyName);242 profile.exclude.push(keyName);
243 } else {243 } else {
244 profile.exclude.splice(profile.exclude.indexOf(keyName), 1);244 const index = profile.exclude.indexOf(keyName);
245 index !== -1 && profile.exclude.splice(index, 1);
245 }246 }
246 });247 });
247 const isNameTaken = (n) => extension_settings.connectionManager.profiles.some(p => p.name === n);248 const isNameTaken = (n) => extension_settings.connectionManager.profiles.some(p => p.name === n);