1
0
mirror of https://github.com/mifi/lossless-cut.git synced 2024-11-22 02:12:30 +01:00

fix showItemInFolder on macos

fixes #1762
This commit is contained in:
Mikael Finstad 2023-12-02 20:32:27 +08:00
parent 2c7f166e01
commit 68804229d6
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26
3 changed files with 7 additions and 3 deletions

View File

@ -267,6 +267,8 @@ function initApp() {
await shell.trashItem(path);
});
ipcMain.handle('showItemInFolder', (e, path) => shell.showItemInFolder(path));
ipcMain.on('apiKeyboardActionResponse', (e, { id }) => {
apiKeyboardActionRequests.get(id)?.();
});

View File

@ -11,10 +11,9 @@ import { parseDuration, formatDuration } from '../util/duration';
import Swal, { swalToastOptions, toast } from '../swal';
import { parseYouTube } from '../edlFormats';
import CopyClipboardButton from '../components/CopyClipboardButton';
import { isWindows } from '../util';
import { isWindows, showItemInFolder } from '../util';
const { dialog } = window.require('@electron/remote');
const { shell } = window.require('electron');
const ReactSwal = withReactContent(Swal);
@ -571,7 +570,7 @@ export async function openDirToast({ filePath, text, html, ...props }) {
html,
...props,
});
if (value) shell.showItemInFolder(filePath);
if (value) showItemInFolder(filePath);
}
const UnorderedList = ({ children }) => <ul style={{ paddingLeft: '1em' }}>{children}</ul>;

View File

@ -19,6 +19,9 @@ const { unlink } = fsExtra;
const trashFile = async (path) => ipcRenderer.invoke('tryTrashItem', path);
export const showItemInFolder = async (path) => ipcRenderer.invoke('showItemInFolder', path);
export function getFileDir(filePath) {
return filePath ? dirname(filePath) : undefined;
}