Skip to content
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
enh(NavigationManager): Use ID as fallback for app property of entries
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux authored and backportbot-nextcloud[bot] committed Dec 7, 2023
commit b82a7d6102dbae6460c7cfffff3a1eadc3041025
10 changes: 8 additions & 2 deletions lib/private/NavigationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ public function add($entry) {
return;
}

$id = $entry['id'];

$entry['active'] = false;
$entry['unread'] = $this->unreadCounters[$id] ?? 0;
if (!isset($entry['icon'])) {
$entry['icon'] = '';
}
Expand All @@ -106,9 +109,12 @@ public function add($entry) {
$entry['type'] = 'link';
}

$id = $entry['id'];
$entry['unread'] = $this->unreadCounters[$id] ?? 0;
if ($entry['type'] === 'link') {
// app might not be set when using closures, in this case try to fallback to ID
if (!isset($entry['app']) && $this->appManager->isEnabledForUser($id)) {
$entry['app'] = $id;
}

// This is the default app that will always be shown first
$entry['default'] = ($entry['app'] ?? false) === $this->defaultApp;
// Set order from user defined app order
Expand Down