Skip to content

Commit 13c67bb

Browse files
Merge pull request #405 from AllenInstitute/bugfix/ZEN-wrong-path
bugfix/ZEN-wrong-path
2 parents 1678935 + 4bcde2c commit 13c67bb

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

packages/core/hooks/useOpenWithMenuItems/index.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ export default (fileDetails?: FileDetail, filters?: FileFilter[]): IContextualMe
222222
key: `open-with-${name}`,
223223
text: name,
224224
title: `Open files with ${name}`,
225-
disabled: !filters && !fileDetails,
225+
disabled:
226+
(!filters && !fileDetails) ||
227+
(app.filePath.toLowerCase().includes("zen") && !fileDetails?.localPath),
226228
onClick() {
227229
if (filters) {
228230
dispatch(interaction.actions.openWith(app, filters));

packages/core/state/interaction/logics.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,13 @@ const openWithLogic = createLogic({
489489
} else {
490490
filesToOpen = await fileSelection.fetchAllDetails();
491491
}
492+
492493
const filePaths = await Promise.all(
493-
filesToOpen.map((file) => executionEnvService.formatPathForHost(file.path))
494+
// Default to local path for desktop apps
495+
filesToOpen.map((file) => {
496+
const filePath = file.localPath ?? file.path;
497+
return executionEnvService.formatPathForHost(filePath);
498+
})
494499
);
495500

496501
// Open the files in the specified executable

0 commit comments

Comments
 (0)