chore: adding parameters to file picker in logical order

This commit is contained in:
Marco Rodolfi
2023-06-22 17:25:38 +02:00
parent 186c70591a
commit ae887e10d6
2 changed files with 4 additions and 4 deletions
@@ -29,6 +29,7 @@ const installFromZip = async () => {
return; return;
} }
window.DeckyPluginLoader.openFilePickerV2( window.DeckyPluginLoader.openFilePickerV2(
FileSelectionType.FILE,
path, path,
true, true,
true, true,
@@ -36,7 +37,6 @@ const installFromZip = async () => {
['zip'], ['zip'],
false, false,
false, false,
FileSelectionType.FILE,
).then((val) => { ).then((val) => {
const url = `file://${val.path}`; const url = `file://${val.path}`;
console.log(`Installing plugin locally from ${url}`); console.log(`Installing plugin locally from ${url}`);
+3 -3
View File
@@ -366,6 +366,7 @@ class PluginLoader extends Logger {
): Promise<{ path: string; realpath: string }> { ): Promise<{ path: string; realpath: string }> {
if (selectFiles) { if (selectFiles) {
return this.openFilePickerV2( return this.openFilePickerV2(
FileSelectionType.FILE,
startPath, startPath,
true, true,
true, true,
@@ -374,10 +375,10 @@ class PluginLoader extends Logger {
undefined, undefined,
undefined, undefined,
undefined, undefined,
FileSelectionType.FILE,
); );
} else { } else {
return this.openFilePickerV2( return this.openFilePickerV2(
FileSelectionType.FOLDER,
startPath, startPath,
false, false,
true, true,
@@ -386,12 +387,12 @@ class PluginLoader extends Logger {
undefined, undefined,
undefined, undefined,
undefined, undefined,
FileSelectionType.FOLDER,
); );
} }
} }
openFilePickerV2( openFilePickerV2(
select: FileSelectionType,
startPath: string, startPath: string,
includeFiles?: boolean, includeFiles?: boolean,
includeFolders?: boolean, includeFolders?: boolean,
@@ -400,7 +401,6 @@ class PluginLoader extends Logger {
showHiddenFiles?: boolean, showHiddenFiles?: boolean,
allowAllFiles?: boolean, allowAllFiles?: boolean,
max?: number, max?: number,
select?: FileSelectionType,
): Promise<{ path: string; realpath: string }> { ): Promise<{ path: string; realpath: string }> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const Content = ({ closeModal }: { closeModal?: () => void }) => ( const Content = ({ closeModal }: { closeModal?: () => void }) => (