diff options
| author | Marco Rodolfi <marco.rodolfi@tuta.io> | 2023-06-22 11:58:00 +0200 |
|---|---|---|
| committer | Marco Rodolfi <marco.rodolfi@tuta.io> | 2023-06-22 11:58:00 +0200 |
| commit | f1576c7798a8cc14d5c93b784df1a67bb764d08c (patch) | |
| tree | e2a4d8855f8b00e39f242d4c263a71f9e04ec73a | |
| parent | 388526d02d46720dd7942d0633d4688e89584449 (diff) | |
| download | decky-loader-f1576c7798a8cc14d5c93b784df1a67bb764d08c.tar.gz decky-loader-f1576c7798a8cc14d5c93b784df1a67bb764d08c.zip | |
Chore: Better logical order for file picker v2 function call
| -rw-r--r-- | frontend/src/components/modals/filepicker/index.tsx | 9 | ||||
| -rw-r--r-- | frontend/src/plugin-loader.tsx | 6 |
2 files changed, 11 insertions, 4 deletions
diff --git a/frontend/src/components/modals/filepicker/index.tsx b/frontend/src/components/modals/filepicker/index.tsx index 102f813b..7f77b4ef 100644 --- a/frontend/src/components/modals/filepicker/index.tsx +++ b/frontend/src/components/modals/filepicker/index.tsx @@ -127,13 +127,20 @@ const iconStyles = { const FilePicker: FunctionComponent<FilePickerProps> = ({ startPath, + //What are we allowing to show in the file picker includeFiles = true, - filter = undefined, includeFolders = true, + //Parameter for specifying a specific filename match + filter = undefined, + //Filter for specific extensions as an array validFileExtensions = undefined, + //Allow to override the fixed extension above allowAllFiles = true, + //If we need to show hidden files and folders (both Win and Linux should work) defaultHidden = false, // false by default makes sense for most users + //How much files per page to show, default 1000 max = 1000, + //Which picking option to select by default fileSelType = FileSelectionType.NONE, onSubmit, closeModal, diff --git a/frontend/src/plugin-loader.tsx b/frontend/src/plugin-loader.tsx index 8190fbc4..e8671faa 100644 --- a/frontend/src/plugin-loader.tsx +++ b/frontend/src/plugin-loader.tsx @@ -368,8 +368,8 @@ class PluginLoader extends Logger { return this.openFilePickerV2( startPath, true, - regex, true, + regex, undefined, undefined, undefined, @@ -380,8 +380,8 @@ class PluginLoader extends Logger { return this.openFilePickerV2( startPath, false, - regex, true, + regex, undefined, undefined, undefined, @@ -394,8 +394,8 @@ class PluginLoader extends Logger { openFilePickerV2( startPath: string, includeFiles?: boolean, - filter?: RegExp | ((file: File) => boolean), includeFolders?: boolean, + filter?: RegExp | ((file: File) => boolean), extensions?: string[], showHiddenFiles?: boolean, allowAllFiles?: boolean, |
