Skip to content

Commit b86aa2a

Browse files
committed
IONOS: Resolve conflicts of update to v30.0.5
Viewer actions moved from Viewer.vue to viewerActions.ts Signed-off-by: Kai Henseler <[email protected]>
2 parents 91f18e7 + 8b89880 commit b86aa2a

File tree

10 files changed

+437
-2193
lines changed

10 files changed

+437
-2193
lines changed

lib/Listener/LoadViewerScript.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
use OCA\Files\Event\LoadAdditionalScriptsEvent;
2929
use OCA\Viewer\AppInfo\Application;
3030
use OCA\Viewer\Event\LoadViewer;
31+
use OCP\AppFramework\Services\IAppConfig;
3132
use OCP\AppFramework\Services\IInitialState;
3233
use OCP\EventDispatcher\Event;
3334
use OCP\EventDispatcher\IEventListener;
@@ -40,24 +41,30 @@
4041
class LoadViewerScript implements IEventListener {
4142
private IInitialState $initialStateService;
4243
private IPreview $previewManager;
44+
private IAppConfig $appConfig;
4345

4446
public function __construct(
4547
IInitialState $initialStateService,
46-
IPreview $previewManager
48+
IPreview $previewManager,
49+
IAppConfig $appConfig
4750
) {
4851
$this->initialStateService = $initialStateService;
4952
$this->previewManager = $previewManager;
53+
$this->appConfig = $appConfig;
5054
}
5155

5256
public function handle(Event $event): void {
5357
if (!($event instanceof LoadViewer || $event instanceof LoadAdditionalScriptsEvent)) {
5458
return;
5559
}
5660

61+
$alwaysShowViewer = $this->appConfig->getAppValue('always_show_viewer', 'no') === 'yes';
62+
5763
Util::addStyle(Application::APP_ID, 'viewer-init');
5864
Util::addStyle(Application::APP_ID, 'viewer-main');
5965
Util::addInitScript(Application::APP_ID, 'viewer-init');
6066
Util::addScript(Application::APP_ID, 'viewer-main', 'files');
6167
$this->initialStateService->provideInitialState('enabled_preview_providers', array_keys($this->previewManager->getProviders()));
68+
$this->initialStateService->provideInitialState("always_show_viewer", $alwaysShowViewer);
6269
}
6370
}

0 commit comments

Comments
 (0)