mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-02 01:25:39 -05:00
Merge from vscode fcf3346a8e9f5ee1e00674461d9e2c2292a14ee3 (#12295)
* Merge from vscode fcf3346a8e9f5ee1e00674461d9e2c2292a14ee3 * Fix test build break * Update distro * Fix build errors * Update distro * Update REH build file * Update build task names for REL * Fix product build yaml * Fix product REH task name * Fix type in task name * Update linux build step * Update windows build tasks * Turn off server publish * Disable REH * Fix typo * Bump distro * Update vscode tests * Bump distro * Fix type in disto * Bump distro * Turn off docker build * Remove docker step from release Co-authored-by: ADS Merger <andresse@microsoft.com> Co-authored-by: Karl Burtram <karlb@microsoft.com>
This commit is contained in:
@@ -7,7 +7,6 @@ import * as azdata from 'azdata';
|
||||
import { AccountAdditionResult } from 'sql/platform/accounts/common/eventTypes';
|
||||
import { IAccountStore } from 'sql/platform/accounts/common/interfaces';
|
||||
import { deepClone } from 'vs/base/common/objects';
|
||||
import { firstIndex } from 'vs/base/common/arrays';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
export default class AccountStore implements IAccountStore {
|
||||
@@ -29,7 +28,7 @@ export default class AccountStore implements IAccountStore {
|
||||
return this.readFromMemento()
|
||||
.then(accounts => {
|
||||
// Determine if account exists and proceed accordingly
|
||||
const match = firstIndex(accounts, account => AccountStore.findAccountByKey(account.key, newAccount.key));
|
||||
const match = accounts.findIndex(account => AccountStore.findAccountByKey(account.key, newAccount.key));
|
||||
return match < 0
|
||||
? this.addToAccountList(accounts, newAccount)
|
||||
: this.updateAccountList(accounts, newAccount.key, matchAccount => AccountStore.mergeAccounts(newAccount, matchAccount));
|
||||
@@ -134,7 +133,7 @@ export default class AccountStore implements IAccountStore {
|
||||
|
||||
private addToAccountList(accounts: azdata.Account[], accountToAdd: azdata.Account): AccountListOperationResult {
|
||||
// Check if the entry already exists
|
||||
const match = firstIndex(accounts, account => AccountStore.findAccountByKey(account.key, accountToAdd.key));
|
||||
const match = accounts.findIndex(account => AccountStore.findAccountByKey(account.key, accountToAdd.key));
|
||||
if (match >= 0) {
|
||||
// Account already exists, we won't do anything
|
||||
return {
|
||||
@@ -159,7 +158,7 @@ export default class AccountStore implements IAccountStore {
|
||||
|
||||
private removeFromAccountList(accounts: azdata.Account[], accountToRemove: azdata.AccountKey): AccountListOperationResult {
|
||||
// Check if the entry exists
|
||||
const match = firstIndex(accounts, account => AccountStore.findAccountByKey(account.key, accountToRemove));
|
||||
const match = accounts.findIndex(account => AccountStore.findAccountByKey(account.key, accountToRemove));
|
||||
if (match >= 0) {
|
||||
// Account exists, remove it from the account list
|
||||
accounts.splice(match, 1);
|
||||
@@ -176,7 +175,7 @@ export default class AccountStore implements IAccountStore {
|
||||
|
||||
private updateAccountList(accounts: azdata.Account[], accountToUpdate: azdata.AccountKey, updateOperation: (account: azdata.Account) => void): AccountListOperationResult {
|
||||
// Check if the entry exists
|
||||
const match = firstIndex(accounts, account => AccountStore.findAccountByKey(account.key, accountToUpdate));
|
||||
const match = accounts.findIndex(account => AccountStore.findAccountByKey(account.key, accountToUpdate));
|
||||
if (match < 0) {
|
||||
// Account doesn't exist, we won't do anything
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user