summaryrefslogtreecommitdiffstats
path: root/apps/dashboard/lib/Controller
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2020-06-23 15:38:07 +0200
committerJulius Härtl <jus@bitgrid.net>2020-07-15 09:28:11 +0200
commit66ce9ede91f4513f4ede97c48e67314038d8345d (patch)
tree2fbcbc62c5973a088c4f40a80ee4659429cd0149 /apps/dashboard/lib/Controller
parentf7c04b04153ac0d66fd3e74fe1ec2d7c661a751e (diff)
downloadnextcloud-server-66ce9ede91f4513f4ede97c48e67314038d8345d.tar.gz
nextcloud-server-66ce9ede91f4513f4ede97c48e67314038d8345d.zip
Initialize panels early to make sure that scripts can be loaded
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/dashboard/lib/Controller')
-rw-r--r--apps/dashboard/lib/Controller/DashboardController.php19
1 files changed, 9 insertions, 10 deletions
diff --git a/apps/dashboard/lib/Controller/DashboardController.php b/apps/dashboard/lib/Controller/DashboardController.php
index 75a34727c8e..040f54a1f53 100644
--- a/apps/dashboard/lib/Controller/DashboardController.php
+++ b/apps/dashboard/lib/Controller/DashboardController.php
@@ -59,16 +59,15 @@ class DashboardController extends Controller {
$this->eventDispatcher->dispatchTyped(new IRegisterPanelEvent($this->dashboardManager));
$dashboardManager = $this->dashboardManager;
- $this->inititalStateService->provideLazyInitialState('dashboard', 'panels', function () use ($dashboardManager) {
- return array_map(function (IPanel $panel) {
- return [
- 'id' => $panel->getId(),
- 'title' => $panel->getTitle(),
- 'iconClass' => $panel->getIconClass(),
- 'url' => $panel->getUrl()
- ];
- }, $dashboardManager->getPanels());
- });
+ $panels = array_map(function (IPanel $panel) {
+ return [
+ 'id' => $panel->getId(),
+ 'title' => $panel->getTitle(),
+ 'iconClass' => $panel->getIconClass(),
+ 'url' => $panel->getUrl()
+ ];
+ }, $dashboardManager->getPanels());
+ $this->inititalStateService->provideInitialState('dashboard', 'panels', $panels);
if (class_exists(LoadViewer::class)) {
$this->eventDispatcher->dispatchTyped(new LoadViewer());