mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
fix(plugin-sql-editor): CB-517 type prediction
This commit is contained in:
@@ -13,7 +13,7 @@ interface ExtensionExecutor {
|
||||
predicate: (extension: IExtension<any>) => extension is T,
|
||||
action: (extension: T) => void
|
||||
) => this;
|
||||
has: (checker: (extension: IExtension<any>) => boolean) => boolean;
|
||||
has: <T extends IExtension<any>> (isProvider: (extension: IExtension<any>) => extension is T) => boolean;
|
||||
}
|
||||
|
||||
export const ExtensionUtils = {
|
||||
@@ -30,8 +30,8 @@ export const ExtensionUtils = {
|
||||
}
|
||||
return this;
|
||||
},
|
||||
has(checker: (extension: IExtension<any>) => boolean): boolean {
|
||||
return extensions.some(extension => checker(extension));
|
||||
has<T extends IExtension<any>>(isProvider: (extension: IExtension<any>) => extension is T): boolean {
|
||||
return extensions.some(isProvider);
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
@@ -60,8 +60,10 @@ export class SqlEditorBootstrap {
|
||||
|
||||
private isSQLEntryDisabled() {
|
||||
const activeView = this.activeViewService.view;
|
||||
if (activeView && ExtensionUtils.from(activeView.extensions).has(isConnectionProvider)) {
|
||||
return false;
|
||||
if (activeView) {
|
||||
return !ExtensionUtils
|
||||
.from(activeView.extensions)
|
||||
.has(isConnectionProvider);
|
||||
}
|
||||
return !this.connectionSchemaManagerService.currentConnectionId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user