aboutsummaryrefslogtreecommitdiffstats
path: root/apps/comments/lib
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2023-11-14 18:30:12 +0100
committerFerdinand Thiessen <opensource@fthiessen.de>2023-11-16 11:54:52 +0100
commitdb2fec1cec8ec490c71eb47180c4cae422bf4f75 (patch)
tree5f97c4bd16428dd40dceeb0e609f100c146cc16c /apps/comments/lib
parent9c3350b3131312e60155c26a8a15b95981c6dd0a (diff)
downloadnextcloud-server-db2fec1cec8ec490c71eb47180c4cae422bf4f75.tar.gz
nextcloud-server-db2fec1cec8ec490c71eb47180c4cae422bf4f75.zip
feat(comments): Use activity tab to mount comments sidebar section if available
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
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');