diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2023-12-06 14:39:33 +0100 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2023-12-06 15:46:22 +0100 |
commit | b1fffb0d3b841089315d44cb589f63b6373f1b90 (patch) | |
tree | e8170d7ede62cd29982eb44c07ba76fbe2760c27 /lib/private/NavigationManager.php | |
parent | e1ecf798d9ccce0b5d0c1b90d6cd93e22c2d9588 (diff) | |
download | nextcloud-server-b1fffb0d3b841089315d44cb589f63b6373f1b90.tar.gz nextcloud-server-b1fffb0d3b841089315d44cb589f63b6373f1b90.zip |
enh(NavigationManager): Use ID as fallback for `app` property of entries
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'lib/private/NavigationManager.php')
-rw-r--r-- | lib/private/NavigationManager.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/private/NavigationManager.php b/lib/private/NavigationManager.php index 27963b8a45d..17573d9db86 100644 --- a/lib/private/NavigationManager.php +++ b/lib/private/NavigationManager.php @@ -95,7 +95,10 @@ class NavigationManager implements INavigationManager { return; } + $id = $entry['id']; + $entry['active'] = false; + $entry['unread'] = $this->unreadCounters[$id] ?? 0; if (!isset($entry['icon'])) { $entry['icon'] = ''; } @@ -106,9 +109,12 @@ class NavigationManager implements INavigationManager { $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 |