aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/AppInfo
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2023-08-14 17:46:43 +0200
committerRobin Appelman <robin@icewind.nl>2023-08-17 10:57:56 +0200
commit838929dc832f29312e98ac67d8f7624e15101b22 (patch)
tree252d90f846d5194a1e5a84d773a7db21fb98636b /apps/files_sharing/lib/AppInfo
parent222ed1f8498ecc232708db002f1c0c886961a3e8 (diff)
downloadnextcloud-server-838929dc832f29312e98ac67d8f7624e15101b22.tar.gz
nextcloud-server-838929dc832f29312e98ac67d8f7624e15101b22.zip
move "aways loaded" sharing script to event listener
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_sharing/lib/AppInfo')
-rw-r--r--apps/files_sharing/lib/AppInfo/Application.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/files_sharing/lib/AppInfo/Application.php b/apps/files_sharing/lib/AppInfo/Application.php
index d89419b8ea9..b76239dc00d 100644
--- a/apps/files_sharing/lib/AppInfo/Application.php
+++ b/apps/files_sharing/lib/AppInfo/Application.php
@@ -116,11 +116,6 @@ class Application extends App implements IBootstrap {
Share::registerBackend('file', File::class);
Share::registerBackend('folder', Folder::class, 'file');
-
- /**
- * Always add main sharing script
- */
- Util::addScript(self::APP_ID, 'main');
}
@@ -139,6 +134,12 @@ class Application extends App implements IBootstrap {
$dispatcher->addListener(ResourcesLoadAdditionalScriptsEvent::class, function () {
\OCP\Util::addScript('files_sharing', 'collaboration');
});
+ $dispatcher->addListener(\OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent::class, function () {
+ /**
+ * Always add main sharing script
+ */
+ Util::addScript(self::APP_ID, 'main');
+ });
// notifications api to accept incoming user shares
$dispatcher->addListener(ShareCreatedEvent::class, function (ShareCreatedEvent $event) {