export model WIP

This commit is contained in:
SPRINX0\prochazka
2024-11-04 17:03:52 +01:00
parent 41162ee2c3
commit e31a52b659
3 changed files with 29 additions and 17 deletions

View File

@@ -9,6 +9,7 @@
export let name;
export let disabled = false;
export let defaultFileName = '';
export let dialogProperties = ['showHiddenFiles', 'openFile'];
const { values, setFieldValue } = getFormContext();
@@ -17,7 +18,7 @@
if (!electron) return;
const filePaths = await electron.showOpenDialog({
defaultPath: values[name],
properties: ['showHiddenFiles', 'openFile'],
properties: dialogProperties,
filters: [{ name: 'All Files', extensions: ['*'] }],
});
const filePath = filePaths && filePaths[0];