| 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); |