diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-09-23 08:43:07 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2020-09-24 20:00:21 +0200 |
commit | 54abcbc2aa188fc481e8ae03dd878262d3158023 (patch) | |
tree | ed94fb1b9e3977314a19cc0f901ebd6c6d030233 /apps/user_status/lib | |
parent | bf91ec45fc84624aa1c76c2ab225b34ad6d35a6f (diff) | |
download | nextcloud-server-54abcbc2aa188fc481e8ae03dd878262d3158023.tar.gz nextcloud-server-54abcbc2aa188fc481e8ae03dd878262d3158023.zip |
Only load user status script when needed
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/user_status/lib')
-rw-r--r-- | apps/user_status/lib/Listener/BeforeTemplateRenderedListener.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/user_status/lib/Listener/BeforeTemplateRenderedListener.php b/apps/user_status/lib/Listener/BeforeTemplateRenderedListener.php index fa3d8ce9e68..0daaaa9fcf2 100644 --- a/apps/user_status/lib/Listener/BeforeTemplateRenderedListener.php +++ b/apps/user_status/lib/Listener/BeforeTemplateRenderedListener.php @@ -28,6 +28,7 @@ namespace OCA\UserStatus\Listener; use OCA\UserStatus\AppInfo\Application; use OCA\UserStatus\Service\JSDataService; use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent; +use OCP\AppFramework\Http\TemplateResponse; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; use OCP\IInitialStateService; @@ -61,7 +62,7 @@ class BeforeTemplateRenderedListener implements IEventListener { return; } - if (!$event->isLoggedIn()) { + if (!$event->isLoggedIn() || $event->getResponse()->getRenderAs() !== TemplateResponse::RENDER_AS_USER) { return; } |