Skip to content

Commit ecd3fad

Browse files
committed
enh(NavigationManager): Use ID as fallback for app property of entries
Signed-off-by: Ferdinand Thiessen <[email protected]>
1 parent e1ecf79 commit ecd3fad

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

lib/private/NavigationManager.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ public function add($entry) {
9595
return;
9696
}
9797

98+
$id = $entry['id'];
99+
98100
$entry['active'] = false;
101+
$entry['unread'] = $this->unreadCounters[$id] ?? 0;
99102
if (!isset($entry['icon'])) {
100103
$entry['icon'] = '';
101104
}
@@ -105,9 +108,11 @@ public function add($entry) {
105108
if (!isset($entry['type'])) {
106109
$entry['type'] = 'link';
107110
}
111+
// app might not be set when using closures, in this case try to fallback to ID
112+
if (!isset($entry['app']) && $this->appManager->isEnabledForUser($id)) {
113+
$entry['app'] = $id;
114+
}
108115

109-
$id = $entry['id'];
110-
$entry['unread'] = $this->unreadCounters[$id] ?? 0;
111116
if ($entry['type'] === 'link') {
112117
// This is the default app that will always be shown first
113118
$entry['default'] = ($entry['app'] ?? false) === $this->defaultApp;

0 commit comments

Comments
 (0)