From d91eac27e95270f358fa6e590bbcdbee0511acc8 Mon Sep 17 00:00:00 2001 From: Louis Chemineau Date: Thu, 10 Oct 2024 15:16:57 +0200 Subject: [PATCH] fix: Make loading the viewer an init script Signed-off-by: Ferdinand Thiessen Signed-off-by: Louis Chemineau --- lib/Listener/LoadViewerScript.php | 1 + src/components/Images.vue | 4 --- src/init.js | 14 ++++++++++ src/main.js | 10 +++---- src/services/FilesActionHandler.js | 36 +++++++++++++++++++++++-- src/services/Viewer.js | 3 ++- src/views/Viewer.vue | 43 +++++------------------------- webpack.config.ts | 5 ++++ 8 files changed, 66 insertions(+), 50 deletions(-) create mode 100644 src/init.js diff --git a/lib/Listener/LoadViewerScript.php b/lib/Listener/LoadViewerScript.php index 0e4681c61..5a7ad7f0f 100644 --- a/lib/Listener/LoadViewerScript.php +++ b/lib/Listener/LoadViewerScript.php @@ -54,6 +54,7 @@ public function handle(Event $event): void { return; } + Util::addInitScript(Application::APP_ID, 'viewer-init', 'files'); Util::addScript(Application::APP_ID, 'viewer-main', 'files'); $this->initialStateService->provideInitialState('enabled_preview_providers', array_keys($this->previewManager->getProviders())); } diff --git a/src/components/Images.vue b/src/components/Images.vue index 4f5138f18..d1bb850dc 100644 --- a/src/components/Images.vue +++ b/src/components/Images.vue @@ -86,8 +86,6 @@