mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
Merge pull request #161 from dbeaver/fix/disconnect-button
fix(core-connections): disconnect btn disabled logic
This commit is contained in:
@@ -46,6 +46,7 @@ export class ConnectionDialogsService {
|
||||
order: 2,
|
||||
title: 'app_shared_connectionMenu_disconnect',
|
||||
onClick: () => this.connectionsManagerService.closeAllConnections(),
|
||||
isDisabled: () => !this.connectionsManagerService.hasAnyConnection(true),
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -83,7 +83,10 @@ export class ConnectionsManagerService {
|
||||
await this.afterConnectionClose(id);
|
||||
}
|
||||
|
||||
hasAnyConnection(): boolean {
|
||||
hasAnyConnection(connected?: boolean): boolean {
|
||||
if (connected) {
|
||||
return Array.from(this.connectionInfo.data.values()).some(connection => connection.connected);
|
||||
}
|
||||
return !!Array.from(this.connectionInfo.data.values()).length;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user