Skip to content

Commit

Permalink
Add an error log message that notifications app isn't enabled at file…
Browse files Browse the repository at this point in the history
…s_reminders app load.

Signed-off-by: Faisal Alghamdi <[email protected]>
  • Loading branch information
falghamdi125 committed Nov 13, 2024
1 parent 17659d3 commit 5ebe213
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/files_reminders/appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<description><![CDATA[**📣 File reminders**
Set file reminders.
Note: to use the `File reminders` app, ensure that the `Notifications` app is installed and enabled. The `Notifications` app provides the necessary APIs for the `File reminders` app to work correctly.
]]></description>
<version>1.4.0</version>
<licence>agpl</licence>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\Util;
use Psr\Log\LoggerInterface;

/** @template-implements IEventListener<LoadAdditionalScriptsEvent> */
class LoadAdditionalScriptsListener implements IEventListener {
public function __construct(
private IAppManager $appManager,
private LoggerInterface $logger,
) {
}

Expand All @@ -29,6 +31,7 @@ public function handle(Event $event): void {
}

if (!$this->appManager->isEnabledForUser('notifications')) {
$this->logger->error('Failed to register the `files_reminders` app. This could happen due to the `notifications` app being disabled.', ['app' => 'files_reminders']);
return;
}

Expand Down

0 comments on commit 5ebe213

Please sign in to comment.