From 7a90be554c72db976a244f4e27a1ce3bfe35e4ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Mon, 13 Jul 2020 16:12:04 +0200 Subject: [PATCH] Also load files app scripts when user is logged in MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Listeners/FilesSharingLoadAdditionalScriptsListener.php | 3 --- src/public.js | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Listeners/FilesSharingLoadAdditionalScriptsListener.php b/lib/Listeners/FilesSharingLoadAdditionalScriptsListener.php index bf097ddb4..9af5bd5bb 100644 --- a/lib/Listeners/FilesSharingLoadAdditionalScriptsListener.php +++ b/lib/Listeners/FilesSharingLoadAdditionalScriptsListener.php @@ -47,9 +47,6 @@ class FilesSharingLoadAdditionalScriptsListener implements IEventListener { } public function handle(Event $event): void { - if (!$this->userSession->isLoggedIn()) { - return; - } \OCP\Util::addScript('text', 'public'); \OCP\Util::addStyle('text', 'icons'); diff --git a/src/public.js b/src/public.js index 785a80ac9..f8c031264 100644 --- a/src/public.js +++ b/src/public.js @@ -15,6 +15,10 @@ documentReady(() => { const mimetype = document.getElementById('mimetype').value const sharingToken = document.getElementById('sharingToken') ? document.getElementById('sharingToken').value : null + if (!sharingToken) { + return + } + if (dir !== '') { OC.Plugins.register('OCA.Files.FileList', FilesWorkspacePlugin) registerFileActionFallback()