aboutsummaryrefslogtreecommitdiffstats
path: root/apps/comments/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/comments/lib')
-rw-r--r--apps/comments/lib/Listener/LoadSidebarScripts.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/comments/lib/Listener/LoadSidebarScripts.php b/apps/comments/lib/Listener/LoadSidebarScripts.php
index a77cd4e0af3..39c81c03ad1 100644
--- a/apps/comments/lib/Listener/LoadSidebarScripts.php
+++ b/apps/comments/lib/Listener/LoadSidebarScripts.php
@@ -28,6 +28,8 @@ namespace OCA\Comments\Listener;
use OCA\Comments\AppInfo\Application;
use OCA\Files\Event\LoadSidebar;
+use OCP\App\IAppManager;
+use OCP\AppFramework\Services\IInitialState;
use OCP\Comments\ICommentsManager;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
@@ -36,6 +38,8 @@ use OCP\Util;
class LoadSidebarScripts implements IEventListener {
public function __construct(
private ICommentsManager $commentsManager,
+ private IInitialState $initialState,
+ private IAppManager $appManager,
) {
}
@@ -46,6 +50,8 @@ class LoadSidebarScripts implements IEventListener {
$this->commentsManager->load();
+ $this->initialState->provideInitialState('activityEnabled', $this->appManager->isEnabledForUser('activity'));
+
// TODO: make sure to only include the sidebar script when
// we properly split it between files list and sidebar
Util::addScript(Application::APP_ID, 'comments');