diff options
author | Christopher Ng <chrng8@gmail.com> | 2023-08-04 09:22:58 -0700 |
---|---|---|
committer | Andy Scherzinger <info@andy-scherzinger.de> | 2023-08-10 12:28:19 +0200 |
commit | 0131005066a64e94a695af4434d3dc700853ede9 (patch) | |
tree | 4d6a3a47010ba216c6fbb2dafb735b44aa669c03 /apps/files_reminders/lib | |
parent | 3bba555891a4356629d7e2b45718af7ca863b428 (diff) | |
download | nextcloud-server-0131005066a64e94a695af4434d3dc700853ede9.tar.gz nextcloud-server-0131005066a64e94a695af4434d3dc700853ede9.zip |
fix: load script
Signed-off-by: Christopher Ng <chrng8@gmail.com>
(cherry picked from commit 89692cf8a1dac636302b7918580960f6a8a1d690)
Diffstat (limited to 'apps/files_reminders/lib')
-rw-r--r-- | apps/files_reminders/lib/Listener/LoadAdditionalScriptsListener.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/files_reminders/lib/Listener/LoadAdditionalScriptsListener.php b/apps/files_reminders/lib/Listener/LoadAdditionalScriptsListener.php index 9eadc518851..1e7f63d8e0d 100644 --- a/apps/files_reminders/lib/Listener/LoadAdditionalScriptsListener.php +++ b/apps/files_reminders/lib/Listener/LoadAdditionalScriptsListener.php @@ -28,16 +28,25 @@ namespace OCA\FilesReminders\Listener; use OCA\Files\Event\LoadAdditionalScriptsEvent; use OCA\FilesReminders\AppInfo\Application; +use OCP\App\IAppManager; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; use OCP\Util; class LoadAdditionalScriptsListener implements IEventListener { + public function __construct( + private IAppManager $appManager, + ) {} + public function handle(Event $event): void { if (!($event instanceof LoadAdditionalScriptsEvent)) { return; } + if (!$this->appManager->isEnabledForUser('notifications')) { + return; + } + Util::addScript(Application::APP_ID, 'main'); } } |