mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-08 01:28:26 -05:00
Fix context menu for disconnected server nodes (#12018)
* Fix context menu for disconnected server nodes * Fix strict compile
This commit is contained in:
@@ -1372,7 +1372,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
return credentials;
|
||||
}
|
||||
|
||||
public getServerInfo(profileId: string): azdata.ServerInfo {
|
||||
public getServerInfo(profileId: string): azdata.ServerInfo | undefined {
|
||||
let profile = this._connectionStatusManager.findConnectionByProfileId(profileId);
|
||||
if (!profile) {
|
||||
return undefined;
|
||||
|
||||
@@ -143,7 +143,9 @@ export class ServerTreeActionProvider {
|
||||
let serverInfoContextKey = new ServerInfoContextKey(scopedContextService);
|
||||
if (connectionProfile.id) {
|
||||
let serverInfo = this._connectionManagementService.getServerInfo(connectionProfile.id);
|
||||
serverInfoContextKey.set(serverInfo);
|
||||
if (serverInfo) {
|
||||
serverInfoContextKey.set(serverInfo);
|
||||
}
|
||||
}
|
||||
let treeNodeContextKey = new TreeNodeContextKey(scopedContextService);
|
||||
if (context.treeNode) {
|
||||
|
||||
Reference in New Issue
Block a user