mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
fix(plugin-sql-editor-navigation-tab-resource): CB-2122 error message on context menu opening
This commit is contained in:
@@ -160,15 +160,24 @@ export class PluginBootstrap extends Bootstrap {
|
||||
try {
|
||||
const nodeInfo = await contexts.getContext(this.navNodeManagerService.navigationNavNodeContext);
|
||||
const node = await this.navNodeInfoResource.load(data.nodeId);
|
||||
const resource = await this.navResourceNodeService.loadResourceInfo(node.id);
|
||||
|
||||
if (node.nodeType !== RESOURCE_NODE_TYPE || !isScript(node.id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const resource = await this.navResourceNodeService.loadResourceInfo(node.id);
|
||||
|
||||
if (!resource) {
|
||||
throw new Error('Resource not found');
|
||||
if (data.type === NavigationType.open) {
|
||||
throw new Error('Resource not found');
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
nodeInfo.markOpen();
|
||||
|
||||
if (data.type !== NavigationType.open) {
|
||||
return;
|
||||
}
|
||||
|
||||
const maxSize = this.sqlEditorSettingsService.settings.getValue('maxFileSize');
|
||||
@@ -184,12 +193,6 @@ export class PluginBootstrap extends Bootstrap {
|
||||
return;
|
||||
}
|
||||
|
||||
nodeInfo.markOpen();
|
||||
|
||||
if (data.type !== NavigationType.open) {
|
||||
return;
|
||||
}
|
||||
|
||||
const tab = this.sqlEditorTabResourceService.getResourceTab(node.id);
|
||||
|
||||
if (tab) {
|
||||
|
||||
Reference in New Issue
Block a user