From aede39f114f032f9db108179ec9dad5c67915a6c Mon Sep 17 00:00:00 2001 From: linonetwo Date: Wed, 21 Jun 2023 14:53:36 +0800 Subject: [PATCH] fix: for file path, use openPath instead of openExternal --- src/services/view/setupViewFileProtocol.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/services/view/setupViewFileProtocol.ts b/src/services/view/setupViewFileProtocol.ts index 93866801..ef5fe2bb 100644 --- a/src/services/view/setupViewFileProtocol.ts +++ b/src/services/view/setupViewFileProtocol.ts @@ -19,9 +19,12 @@ export function handleOpenFileExternalLink(nextUrl: string): INewWindowAction | const absoluteFilePath = nativeService.formatFileUrlToAbsolutePath(nextUrl); const fileStat = fs.statSync(absoluteFilePath); if (fileStat.isDirectory()) { - void shell.openExternal(absoluteFilePath); - } else if (fileStat.isFile()) { + logger.info(`Opening directory ${absoluteFilePath}`, { function: 'handleOpenFileExternalLink' }); void shell.openPath(absoluteFilePath); + } else if (fileStat.isFile()) { + logger.info(`Opening file ${absoluteFilePath}`, { function: 'handleOpenFileExternalLink' }); + void shell.openPath(absoluteFilePath); + // void shell.openExternal(absoluteFilePath); } return { action: 'deny',