diff --git a/packages/file-handling/src/clipboard.js b/packages/file-handling/src/clipboard.js index b975f784ed9a02cdd4c7a6b5b9c666f2127ccd59..7ad1476e51b653b10ca05133b5357e8b2a59ec22 100644 --- a/packages/file-handling/src/clipboard.js +++ b/packages/file-handling/src/clipboard.js @@ -321,6 +321,8 @@ export class Clipboard extends ScopedElementsMixin(AdapterLitElement) { * @returns {boolean} */ checkFileType(file) { + if (this.allowedMimeTypes === '') + return true; // check if file is allowed const [fileMainType, fileSubType] = file.type.split('/'); const mimeTypes = this.allowedMimeTypes.split(','); diff --git a/packages/file-handling/src/nextcloud-file-picker.js b/packages/file-handling/src/nextcloud-file-picker.js index 4938bdb8edd963a2ec26fab7087e0a9d13099106..f7030b1a0a6b2f46de4a893a4d436ae14675f3c9 100644 --- a/packages/file-handling/src/nextcloud-file-picker.js +++ b/packages/file-handling/src/nextcloud-file-picker.js @@ -33,7 +33,7 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { this.directoryPath = ''; this.webDavClient = null; this.tabulatorTable = null; - this.allowedMimeTypes = '*/*'; + this.allowedMimeTypes = ''; this.directoriesOnly = false; this.maxSelectedItems = true; this.loading = false; @@ -335,7 +335,7 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { this.tabulatorTable.options.selectableRangeMode = "click"; }*/ - if (typeof this.allowedMimeTypes !== 'undefined' && !this.directoriesOnly) { + if (typeof this.allowedMimeTypes !== 'undefined' && this.allowedMimeTypes !== '' && !this.directoriesOnly) { this.tabulatorTable.setFilter(this.checkFileType, this.allowedMimeTypes); } // comment this in to show only directories in filesink @@ -381,6 +381,8 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { * @param filterParams */ checkFileType(data, filterParams) { + if (filterParams === '') + return true; if (typeof data.mime === 'undefined') { return true; }