mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 08:44:07 -04:00
fix: load script
Signed-off-by: Christopher Ng <chrng8@gmail.com>
This commit is contained in:
parent
683041cdb8
commit
89692cf8a1
1 changed files with 9 additions and 0 deletions
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue