Only load user status script when needed

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2020-09-23 08:43:07 +02:00 committed by Roeland Jago Douma
parent bf91ec45fc
commit 54abcbc2aa
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 2 additions and 1 deletions

View 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;
}