mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-09 01:32:34 -05:00
Set current connection as the selected connection in schema compare dialog (#21682)
* Set current connection as the selected connection in schema compare dialog * Address comment
This commit is contained in:
@@ -88,7 +88,7 @@ export class SchemaCompareDialog {
|
||||
// connection to use if schema compare wasn't launched from a database or no previous source/target
|
||||
let connection = await azdata.connection.getCurrentConnection();
|
||||
if (connection) {
|
||||
this.connectionId = connection.connectionId;
|
||||
this.connectionId = connection.connectionId; // current active connection
|
||||
}
|
||||
|
||||
this.dialog = azdata.window.createModelViewDialog(loc.SchemaCompareLabel);
|
||||
@@ -874,13 +874,12 @@ export class SchemaCompareDialog {
|
||||
finalName = c.options.connectionName;
|
||||
}
|
||||
|
||||
// use previously selected server or current connection if there is one
|
||||
if (endpointInfo && !isNullOrUndefined(endpointInfo.serverName) && !isNullOrUndefined(endpointInfo.serverDisplayName)
|
||||
&& c.options.server.toLowerCase() === endpointInfo.serverName.toLowerCase()
|
||||
&& finalName.toLowerCase() === endpointInfo.serverDisplayName.toLowerCase()) {
|
||||
idx = count;
|
||||
}
|
||||
else if (c.connectionId === this.connectionId) {
|
||||
// use current connection else use previously selected server if there is one
|
||||
if ((c.connectionId === this.connectionId) ||
|
||||
(endpointInfo && !isNullOrUndefined(endpointInfo.serverName) && !isNullOrUndefined(endpointInfo.serverDisplayName)
|
||||
&& c.options.server.toLowerCase() === endpointInfo.serverName.toLowerCase()
|
||||
&& finalName.toLowerCase() === endpointInfo.serverDisplayName.toLowerCase()
|
||||
&& idx === -1)) { // select previous server only if current connection hasn't been set already
|
||||
idx = count;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user