mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Initialize panels early to make sure that scripts can be loaded
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
f7c04b0415
commit
66ce9ede91
1 changed files with 9 additions and 10 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Reference in a new issue