diff --git a/packages/core/src/common/selection-command-handler.ts b/packages/core/src/common/selection-command-handler.ts index d1dddf2abd46c..e85b79b8e9d8d 100644 --- a/packages/core/src/common/selection-command-handler.ts +++ b/packages/core/src/common/selection-command-handler.ts @@ -33,7 +33,7 @@ export class SelectionCommandHandler implements CommandHandler { isVisible(...args: any[]): boolean { const selection = this.getSelection(...args); - return !!selection && (!this.options.isVisible || (this.options.isVisible as any)(selection as any, ...args)); + return !this.options.isVisible || (this.options.isVisible as any)(selection as any, ...args); } isEnabled(...args: any[]): boolean { diff --git a/packages/filesystem/src/browser/filesystem-frontend-contribution.ts b/packages/filesystem/src/browser/filesystem-frontend-contribution.ts index 8f624163dfaef..0813a7904b1bc 100644 --- a/packages/filesystem/src/browser/filesystem-frontend-contribution.ts +++ b/packages/filesystem/src/browser/filesystem-frontend-contribution.ts @@ -123,7 +123,7 @@ export class FileSystemFrontendContribution implements FrontendApplicationContri commands.registerCommand(FileSystemCommands.UPLOAD, new FileSelection.CommandHandler(this.selectionService, { multi: false, isEnabled: selection => this.canUpload(selection), - isVisible: selection => this.canUpload(selection), + isVisible: () => !environment.electron.is(), execute: selection => this.upload(selection) })); } diff --git a/packages/markers/src/browser/problem/problem-selection.ts b/packages/markers/src/browser/problem/problem-selection.ts index 39552b170de0a..4f3ef69a22704 100644 --- a/packages/markers/src/browser/problem/problem-selection.ts +++ b/packages/markers/src/browser/problem/problem-selection.ts @@ -14,6 +14,7 @@ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 // ***************************************************************************** +/* eslint-disable @typescript-eslint/no-explicit-any */ import { SelectionService } from '@theia/core/lib/common/selection-service'; import { SelectionCommandHandler } from '@theia/core/lib/common/selection-command-handler'; import { Marker } from '../../common/marker'; @@ -39,6 +40,11 @@ export namespace ProblemSelection { options ); } + + override isVisible(...args: any[]): boolean { + const selection = this.getSelection(...args); + return !!selection && super.isVisible(args); + } } }