diff options
author | Christopher Ng <chrng8@gmail.com> | 2023-08-04 09:22:58 -0700 |
---|---|---|
committer | Christopher Ng <chrng8@gmail.com> | 2023-08-09 10:41:18 -0700 |
commit | 89692cf8a1dac636302b7918580960f6a8a1d690 (patch) | |
tree | b6a699f0a4532c532c8091f5daa87ccbc48581f9 /apps/files_reminders | |
parent | 683041cdb826b7b4b79bfb28e400efdd459a6b0b (diff) | |
download | nextcloud-server-89692cf8a1dac636302b7918580960f6a8a1d690.tar.gz nextcloud-server-89692cf8a1dac636302b7918580960f6a8a1d690.zip |
fix: load script
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Diffstat (limited to 'apps/files_reminders')
-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'); } } |