From 1fa58be1aa78ff6216b7a129925a7bb270ac9fe1 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 11 Jan 2022 15:06:54 +0100 Subject: Fix file picker not respecting hidden files settings This will only respect the setting inside the file app. For other apps we will either need to do an API call or add an input field with the same idea to spare a blocking api call. Signed-off-by: Carl Schwan --- core/src/OC/dialogs.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'core/src/OC') diff --git a/core/src/OC/dialogs.js b/core/src/OC/dialogs.js index b1d0e24c076..8efcd4078dd 100644 --- a/core/src/OC/dialogs.js +++ b/core/src/OC/dialogs.js @@ -1143,6 +1143,16 @@ const Dialogs = { }) } + // Check if the showHidden input field exist and if it exist follow it + // Otherwise just show the hidden files + const showHiddenInput = document.getElementById('showHiddenFiles') + const showHidden = showHiddenInput === null || showHiddenInput.value === "1" + if (!showHidden) { + files = files.filter(function(file) { + return !file.name.startsWith('.') + }) + } + var Comparators = { name: function(fileInfo1, fileInfo2) { if (fileInfo1.type === 'dir' && fileInfo2.type !== 'dir') { -- cgit v1.2.3