From e1a173caa1d1a5d03d0fa7658577094fdce41fe1 Mon Sep 17 00:00:00 2001
From: Tamara Steinwender <tamara.steinwender@tugraz.at>
Date: Tue, 27 Jul 2021 10:15:50 +0200
Subject: [PATCH] Remove select all bug

---
 packages/file-handling/src/clipboard.js             | 2 ++
 packages/file-handling/src/nextcloud-file-picker.js | 6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/packages/file-handling/src/clipboard.js b/packages/file-handling/src/clipboard.js
index b975f784..7ad1476e 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 4938bdb8..f7030b1a 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;
         }
-- 
GitLab