mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
fix default server not being chosen (#5583)
This commit is contained in:
@@ -441,6 +441,9 @@ export class SchemaCompareDialog {
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// reverse list so that most recent connections are first
|
||||||
|
cons.reverse();
|
||||||
|
|
||||||
let count = -1;
|
let count = -1;
|
||||||
let idx = -1;
|
let idx = -1;
|
||||||
let values = cons.map(c => {
|
let values = cons.map(c => {
|
||||||
@@ -465,6 +468,13 @@ export class SchemaCompareDialog {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// move server of current connection to the top of the list so it is the default
|
||||||
|
if (idx >= 1) {
|
||||||
|
let tmp = values[0];
|
||||||
|
values[0] = values[idx];
|
||||||
|
values[idx] = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
values = values.reduce((uniqueValues, conn) => {
|
values = values.reduce((uniqueValues, conn) => {
|
||||||
let exists = uniqueValues.find(x => x.displayName === conn.displayName);
|
let exists = uniqueValues.find(x => x.displayName === conn.displayName);
|
||||||
if (!exists) {
|
if (!exists) {
|
||||||
@@ -473,16 +483,6 @@ export class SchemaCompareDialog {
|
|||||||
return uniqueValues;
|
return uniqueValues;
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// reverse list so that most recent connections show first
|
|
||||||
values.reverse();
|
|
||||||
|
|
||||||
// move server of current connection to the top of the list so it is the default
|
|
||||||
if (idx >= 1) {
|
|
||||||
let tmp = values[0];
|
|
||||||
values[0] = values[idx];
|
|
||||||
values[idx] = tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
return values;
|
return values;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user