Skip to content

Commit

Permalink
Merge pull request #5105 from nextcloud/bugfix/noid/collections
Browse files Browse the repository at this point in the history
Make sure that project resources scripts event is properly emitted
  • Loading branch information
nickvergessen authored Feb 12, 2021
2 parents 1cfb072 + 86d7798 commit 69c9a7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 2 additions & 0 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Http\Template\PublicTemplateResponse;
use OCP\AppFramework\Services\IInitialState;
use OCP\EventDispatcher\GenericEvent;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\IRootFolder;
use OCP\ICacheFactory;
Expand Down Expand Up @@ -255,6 +256,7 @@ public function index(string $token = '', string $callUser = '', string $passwor
$this->eventDispatcher->dispatchTyped(new LoadViewer());
}

$this->eventDispatcher->dispatch('\OCP\Collaboration\Resources::loadAdditionalScripts', new GenericEvent());
$response = new TemplateResponse($this->appName, 'index');
$csp = new ContentSecurityPolicy();
$csp->addAllowedConnectDomain('*');
Expand Down
7 changes: 1 addition & 6 deletions templates/index.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<?php

/** @var \OCP\IL10N $l */
/** @var array $_ */
declare(strict_types=1);

script('spreed', 'talk');

style('spreed', 'merged');
if (($_['user_uid'] ?? '') !== '') {
\OC::$server->getEventDispatcher()->dispatch('\OCP\Collaboration\Resources::loadAdditionalScripts');
}

0 comments on commit 69c9a7e

Please sign in to comment.