From b1e07369b6faf40a6dc9f9bc3ee268f24959e87e Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Wed, 20 Sep 2023 20:55:24 +0200 Subject: [PATCH] fix(FilePicker): Legacy filepicker is broken because the default type was unset Signed-off-by: Ferdinand Thiessen --- lib/legacy.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/legacy.ts b/lib/legacy.ts index 51a8b53dd..671c57bd6 100644 --- a/lib/legacy.ts +++ b/lib/legacy.ts @@ -89,7 +89,7 @@ const spawnDialog = (dialog: Component | AsyncComponent, props: any, onClose: () * @param {Object} [options] additonal options that need to be set * @param {Function} [options.filter] filter function for advanced filtering */ -export async function filepicker(title: string, callback: (s: string | string[], type: FilePickerType) => void, multiselect = false, mimetype?: string | string[], _modal?: boolean, type?: FilePickerType, path?: string, options?: any) { +export async function filepicker(title: string, callback: (s: string | string[], type: FilePickerType) => void, multiselect = false, mimetype?: string | string[], _modal?: boolean, type: FilePickerType = FilePickerType.Choose, path?: string, options?: any) { /** * Create legacy callback wrapper to support old filepicker syntax @@ -145,6 +145,7 @@ export async function filepicker(title: string, callback: (s: string | string[], }) } else { buttonFn = (nodes, path) => { + console.warn('CCAALLEEDD', type) const buttons: IFilePickerButton[] = [] const node = nodes?.[0]?.attributes?.displayName || nodes?.[0]?.basename const target = node || basename(path) @@ -173,6 +174,7 @@ export async function filepicker(title: string, callback: (s: string | string[], icon: IconMove, }) } + console.warn(buttons) return buttons } }