@@ -39,7 +39,7 @@ export default defineComponent({
3939 },
4040 filepickerOptions() {
4141 return {
42- allowPickDirectory: false ,
42+ allowPickDirectory: true ,
4343 buttons: this .buttonFactory ,
4444 container: ` #${this .containerId } ` ,
4545 multiselect: false ,
@@ -53,18 +53,17 @@ export default defineComponent({
5353 buttonFactory(selected : NcNode []): IFilePickerButton [] {
5454 const buttons = [] as IFilePickerButton []
5555 if (selected .length === 0 ) {
56- buttons .push ({
57- label: t (' files' , ' Choose file' ),
58- type: ' tertiary' as never ,
59- callback: this .onClose ,
60- })
61- } else {
62- buttons .push ({
63- label: t (' files' , ' Choose {file}' , { file: selected [0 ].basename }),
64- type: ' primary' ,
65- callback: this .onClose ,
66- })
56+ return []
57+ }
58+ const node = selected .at (0 )
59+ if (node .path === ' /' ) {
60+ return [] // Do not allow selecting the users root folder
6761 }
62+ buttons .push ({
63+ label: t (' files' , ' Choose {file}' , { file: node .displayname }),
64+ type: ' primary' ,
65+ callback: this .onClose ,
66+ })
6867 return buttons
6968 },
7069
0 commit comments