Skip to content

Commit 9f5cd1e

Browse files
SebastianKrupinskikesselb
authored andcommitted
fix: do not show hidden calendars
Signed-off-by: SebastianKrupinski <[email protected]>
1 parent 34b3d58 commit 9f5cd1e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/Dashboard/CalendarWidget.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use OCA\Calendar\Service\JSDataService;
1515
use OCP\AppFramework\Services\IInitialState;
1616
use OCP\AppFramework\Utility\ITimeFactory;
17+
use OCP\Calendar\ICalendarIsEnabled;
1718
use OCP\Calendar\IManager;
1819
use OCP\Dashboard\IAPIWidget;
1920
use OCP\Dashboard\IAPIWidgetV2;
@@ -132,6 +133,9 @@ public function getItems(string $userId, ?string $since = null, int $limit = 7):
132133
];
133134
$widgetItems = [];
134135
foreach ($calendars as $calendar) {
136+
if (interface_exists(ICalendarIsEnabled::class) && $calendar instanceof ICalendarIsEnabled && $calendar->isEnabled() === false) {
137+
continue;
138+
}
135139
if ($calendar->isDeleted()) {
136140
continue;
137141
}

0 commit comments

Comments
 (0)