Skip to content

Commit

Permalink
fixup! Add new LoadAdditionalScriptsEvent
Browse files Browse the repository at this point in the history
Signed-off-by: Roeland Jago Douma <[email protected]>
  • Loading branch information
rullzer committed Sep 16, 2019
1 parent 2cc9447 commit f5a27b8
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,18 @@

namespace OCA\Files\Listener;

use OC\EventDispatcher\SymfonyAdapter;
use OCA\Files\Event\LoadAdditionalScriptsEvent;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\EventDispatcher\IEventListener;
use Symfony\Component\EventDispatcher\GenericEvent;

class LegacyLoadAdditionalScriptsAdapter implements IEventListener {

/** @var IEventDispatcher */
/** @var SymfonyAdapter */
private $dispatcher;

public function __construct(IEventDispatcher $dispatcher) {
public function __construct(SymfonyAdapter $dispatcher) {
$this->dispatcher = $dispatcher;
}

Expand All @@ -43,7 +44,7 @@ public function handle(Event $event): void {
return;
}

$legacyEvent = new Event(null, ['hiddenFields' => []]);
$legacyEvent = new GenericEvent(null, ['hiddenFields' => []]);
$this->dispatcher->dispatch('OCA\Files::loadAdditionalScripts', $legacyEvent);

$hiddenFields = $legacyEvent->getArgument('hiddenFields');
Expand Down

0 comments on commit f5a27b8

Please sign in to comment.