Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Disable dashboard widget if no frontend is available #1519

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: Disable dashboard widget if no frontend is available
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Mar 5, 2024
commit 40ff7f7d4bf5c865f44113b683bda3a17c2b6564
5 changes: 4 additions & 1 deletion lib/Dashboard/TeamDashboardWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use OCA\Circles\Service\CircleService;
use OCA\Circles\Service\ConfigService;
use OCA\Circles\Service\FederatedUserService;
use OCP\App\IAppManager;
use OCP\Dashboard\IAPIWidgetV2;
use OCP\Dashboard\IButtonWidget;
use OCP\Dashboard\IConditionalWidget;
Expand All @@ -50,6 +51,7 @@ public function __construct(
private FederatedUserService $federatedUserService,
private ConfigService $configService,
private IUserSession $userSession,
private IAppManager $appManager,
private LoggerInterface $logger,
) {
}
Expand Down Expand Up @@ -155,6 +157,7 @@ private function getTeamPage(): string {
}

public function isEnabled(): bool {
return $this->configService->getAppValueBool(ConfigService::FRONTEND_ENABLED);
return $this->appManager->isEnabledForUser('contacts') &&
$this->configService->getAppValueBool(ConfigService::FRONTEND_ENABLED);
}
}
Loading