Fix bug where connections edited in connection dialog moved to bottom of group (#2782)

This commit is contained in:
Matt Irvine
2018-10-08 15:41:55 -07:00
committed by GitHub
parent 70141bd049
commit 0bd179c6ca

View File

@@ -84,13 +84,14 @@ export class ConnectionConfig implements IConnectionConfig {
return providerConnectionProfile.matches(connectionProfile);
});
if (sameProfileInList) {
profiles = profiles.filter(value => value !== sameProfileInList);
let profileIndex = profiles.findIndex(value => value === sameProfileInList);
newProfile.id = sameProfileInList.id;
connectionProfile.id = sameProfileInList.id;
profiles[profileIndex] = newProfile;
} else {
profiles.push(newProfile);
}
profiles.push(newProfile);
this.writeConfiguration(Constants.connectionsArrayName, profiles).then(() => {
resolve(connectionProfile);
}).catch(err => {