fix: for file path, use openPath instead of openExternal

This commit is contained in:
linonetwo 2023-06-21 14:53:36 +08:00
parent 1e5c2eabe4
commit aede39f114

View file

@ -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',