]> source.dussan.org Git - nextcloud-server.git/commitdiff
Initialize panels early to make sure that scripts can be loaded
authorJulius Härtl <jus@bitgrid.net>
Tue, 23 Jun 2020 13:38:07 +0000 (15:38 +0200)
committerJulius Härtl <jus@bitgrid.net>
Wed, 15 Jul 2020 07:28:11 +0000 (09:28 +0200)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
apps/dashboard/lib/Controller/DashboardController.php

index 75a34727c8e1d9f42f5d841c38e4a31362c547c1..040f54a1f531d9430eab8591b5e0bbbc0286630b 100644 (file)
@@ -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());