Skip to content

Commit

Permalink
fix: Dispatch render reference event for collabora
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Knorr <[email protected]>
  • Loading branch information
juliusknorr authored and elzody committed Nov 29, 2024
1 parent 307833b commit f2113f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Listener/LoadViewerListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
use OCA\Richdocuments\PermissionManager;
use OCA\Richdocuments\Service\InitialStateService;
use OCA\Viewer\Event\LoadViewer;
use OCP\Collaboration\Reference\RenderReferenceEvent;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\EventDispatcher\IEventListener;
use OCP\Util;

Expand All @@ -23,6 +25,7 @@ class LoadViewerListener implements IEventListener {
public function __construct(
private PermissionManager $permissionManager,
private InitialStateService $initialStateService,
private IEventDispatcher $eventDispatcher,
private ?string $userId,
) {
}
Expand All @@ -34,6 +37,7 @@ public function handle(Event $event): void {
if ($this->permissionManager->isEnabledForUser() && $this->userId !== null) {
$this->initialStateService->provideCapabilities();
Util::addScript('richdocuments', 'richdocuments-viewer', 'viewer');
$this->eventDispatcher->dispatchTyped(new RenderReferenceEvent());
}
}
}

0 comments on commit f2113f2

Please sign in to comment.