Fix bug with new nodes when DB is changed (#1429)

* make new object instead of changing node credentials

* add credential object for new query as well
This commit is contained in:
Aditya Bist 2019-10-14 19:21:58 -07:00 коммит произвёл GitHub
Родитель d91749fa9b
Коммит 094f212124
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -154,7 +154,7 @@ export default class MainController implements vscode.Disposable {
this._context.subscriptions.push(
vscode.commands.registerCommand(
Constants.cmdObjectExplorerNewQuery, async (treeNodeInfo: TreeNodeInfo) => {
const connectionCredentials = treeNodeInfo.connectionCredentials;
const connectionCredentials = Object.assign({}, treeNodeInfo.connectionCredentials);
const databaseName = ObjectExplorerUtils.getDatabaseName(treeNodeInfo);
if (databaseName !== connectionCredentials.database &&
databaseName !== LocalizedConstants.defaultDatabaseLabel) {
@ -186,7 +186,7 @@ export default class MainController implements vscode.Disposable {
Constants.cmdScriptSelect, async (node: TreeNodeInfo) => {
let actionPromise = new Promise<boolean>(async (resolve, reject) => {
const nodeUri = ObjectExplorerUtils.getNodeUri(node);
let connectionCreds = node.connectionCredentials;
let connectionCreds = Object.assign({}, node.connectionCredentials);
const databaseName = ObjectExplorerUtils.getDatabaseName(node);
// if not connected or different database
if (!this.connectionManager.isConnected(nodeUri) ||