]> source.dussan.org Git - nextcloud-server.git/commitdiff
Only load user status script when needed
authorJulius Härtl <jus@bitgrid.net>
Wed, 23 Sep 2020 06:43:07 +0000 (08:43 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Mon, 5 Oct 2020 19:53:04 +0000 (19:53 +0000)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
apps/user_status/lib/Listener/BeforeTemplateRenderedListener.php

index fa3d8ce9e68d27cd3d511934e4608fb8a2690591..0daaaa9fcf2f9a3daea1936ce9d14e8120968d62 100644 (file)
@@ -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;
                }