Skip to content

Commit

Permalink
fix: Load editor in widgets
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Jun 13, 2024
1 parent dab5a6a commit f518b72
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/Listener/TablesReferenceListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@
use OCP\Collaboration\Reference\RenderReferenceEvent;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Util;
use OCA\Text\Event\LoadEditor;

/**
* @template-implements IEventListener<Event|RenderReferenceEvent>
*/
class TablesReferenceListener implements IEventListener {
public function __construct() {
private bool $isLoaded = false;
public function __construct(
private IEventDispatcher $eventDispatcher,
) {
}

public function handle(Event $event): void {
Expand All @@ -21,5 +26,9 @@ public function handle(Event $event): void {
}

Util::addScript(Application::APP_ID, Application::APP_ID . '-reference');
if (!$this->isLoaded && class_exists(LoadEditor::class)) {
$this->isLoaded = true;
$this->eventDispatcher->dispatchTyped(new LoadEditor());

Check failure on line 31 in lib/Listener/TablesReferenceListener.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

UndefinedClass

lib/Listener/TablesReferenceListener.php:31:46: UndefinedClass: Class, interface or enum named OCA\Text\Event\LoadEditor does not exist (see https://psalm.dev/019)

Check failure on line 31 in lib/Listener/TablesReferenceListener.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable28

UndefinedClass

lib/Listener/TablesReferenceListener.php:31:46: UndefinedClass: Class, interface or enum named OCA\Text\Event\LoadEditor does not exist (see https://psalm.dev/019)
}
}
}

0 comments on commit f518b72

Please sign in to comment.