Got file selection to work.

This commit is contained in:
Zachary Elliott 2024-08-03 14:45:20 -06:00
parent 50482ee340
commit c81aded003

View File

@ -117,14 +117,18 @@ const browseFiles = async (win, filters) => {
}; };
const browseFile = async (win, filters) => { const browseFile = async (win, filters) => {
const { filePath } = await dialog.showOpenDialog(win, { const { filePaths } = await dialog.showOpenDialog(win, {
properties: ['openFile'], properties: ['openFile'],
filters filters
}); });
if(!filePath) { if(!filePaths) {
return null; return null;
} }
const filePath = normalizeAndResolvePath(filePaths[0]);
return isFile(filePath) ? filePath : null;
} }
const chooseFileToSave = async (win, preferredFileName = '') => { const chooseFileToSave = async (win, preferredFileName = '') => {