diff --git a/lib/Listener/LoadViewerScript.php b/lib/Listener/LoadViewerScript.php index 552a22b78..51e3466bc 100644 --- a/lib/Listener/LoadViewerScript.php +++ b/lib/Listener/LoadViewerScript.php @@ -11,6 +11,7 @@ use OCA\Files\Event\LoadAdditionalScriptsEvent; use OCA\Viewer\AppInfo\Application; use OCA\Viewer\Event\LoadViewer; +use OCP\AppFramework\Services\IAppConfig; use OCP\AppFramework\Services\IInitialState; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; @@ -28,6 +29,7 @@ class LoadViewerScript implements IEventListener { public function __construct( IInitialState $initialStateService, IPreview $previewManager, + private readonly IAppConfig $appConfig, ) { $this->initialStateService = $initialStateService; $this->previewManager = $previewManager; @@ -39,9 +41,13 @@ public function handle(Event $event): void { } Util::addStyle(Application::APP_ID, 'viewer-init'); + + $alwaysShowViewer = $this->appConfig->getAppValue('always_show_viewer', 'no') === 'yes'; + Util::addStyle(Application::APP_ID, 'viewer-main'); Util::addInitScript(Application::APP_ID, 'viewer-init'); Util::addScript(Application::APP_ID, 'viewer-main', 'files'); $this->initialStateService->provideInitialState('enabled_preview_providers', array_keys($this->previewManager->getProviders())); + $this->initialStateService->provideInitialState('always_show_viewer', $alwaysShowViewer); } } diff --git a/src/components/Default.vue b/src/components/Default.vue new file mode 100644 index 000000000..686b3a5bd --- /dev/null +++ b/src/components/Default.vue @@ -0,0 +1,69 @@ + + + + + + diff --git a/src/components/Images.vue b/src/components/Images.vue index dd07e1441..ecd7534ec 100644 --- a/src/components/Images.vue +++ b/src/components/Images.vue @@ -12,7 +12,8 @@ @close="onClose" />