mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
Fixing dup connections (#22670)
This commit is contained in:
@@ -228,7 +228,12 @@ export class ServerTreeView extends Disposable implements IServerTreeView {
|
|||||||
if (this._tree instanceof AsyncServerTree) {
|
if (this._tree instanceof AsyncServerTree) {
|
||||||
const connectionParentGroup = this._tree.getElementById(newConnection.groupId) as ConnectionProfileGroup;
|
const connectionParentGroup = this._tree.getElementById(newConnection.groupId) as ConnectionProfileGroup;
|
||||||
if (connectionParentGroup) {
|
if (connectionParentGroup) {
|
||||||
connectionParentGroup.connections.push(newConnection);
|
const matchingConnectionIndex = connectionParentGroup.connections.findIndex((connection) => connection.matches(newConnection));
|
||||||
|
if (matchingConnectionIndex !== -1) {
|
||||||
|
connectionParentGroup.connections[matchingConnectionIndex] = newConnection;
|
||||||
|
} else {
|
||||||
|
connectionParentGroup.connections.push(newConnection);
|
||||||
|
}
|
||||||
newConnection.parent = connectionParentGroup;
|
newConnection.parent = connectionParentGroup;
|
||||||
newConnection.groupId = connectionParentGroup.id;
|
newConnection.groupId = connectionParentGroup.id;
|
||||||
await this._tree.updateChildren(connectionParentGroup);
|
await this._tree.updateChildren(connectionParentGroup);
|
||||||
|
|||||||
Reference in New Issue
Block a user