Skip to content

Commit

Permalink
fix: load script
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <chrng8@gmail.com>
  • Loading branch information
Pytal committed Aug 9, 2023
1 parent 683041c commit 89692cf
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,25 @@

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');
}
}

0 comments on commit 89692cf

Please sign in to comment.