diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-02-11 17:59:07 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2019-02-11 17:59:07 +0300 |
commit | c8af169439f3face2323f14390cd654df9eeccf3 (patch) | |
tree | 51fc77bfe92a7e59fa5dafa1cffe45c532014621 /lib/AppInfo | |
parent | 466216a347e840949a95730d71917778c69ed3d6 (diff) |
Use EVENT_LOAD_ADDITIONAL_SCRIPTS_LOGGEDIN to add script
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/AppInfo')
-rw-r--r-- | lib/AppInfo/Application.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 6d691502..f517b27c 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -25,12 +25,11 @@ namespace OCA\FirstRunWizard\AppInfo; use OCA\FirstRunWizard\Notification\Notifier; use OCP\AppFramework\App; +use OCP\AppFramework\Http\TemplateResponse; use OCP\IConfig; use OCP\IL10N; -use OCP\IRequest; use OCP\IUser; use OCP\IUserSession; -use OCP\Util; use Symfony\Component\EventDispatcher\EventDispatcherInterface; class Application extends App { @@ -51,10 +50,12 @@ class Application extends App { } protected function registerScripts() { - \OC_Util::addScript('firstrunwizard', 'about'); - /** @var EventDispatcherInterface $dispatcher */ - $dispatcher = $this->getContainer()->query(EventDispatcherInterface::class); + $dispatcher = $this->getContainer()->getServer()->getEventDispatcher(); + + $dispatcher->addListener(TemplateResponse::EVENT_LOAD_ADDITIONAL_SCRIPTS_LOGGEDIN, function() { + \OC_Util::addScript('firstrunwizard', 'about'); + }); // Display the first run wizard only on the files app, $dispatcher->addListener('OCA\Files::loadAdditionalScripts', function() { |