Skip to content
Snippets Groups Projects
Unverified Commit 0ed8d1c2 authored by John Molakvoæ's avatar John Molakvoæ Committed by GitHub
Browse files

Merge pull request #22531 from nextcloud/fix/save-statuses

Fix dashboard statuses toggling
parents c538b1e4 e8f37dd2
No related branches found
No related tags found
No related merge requests found
......@@ -103,8 +103,12 @@ class DashboardController extends Controller {
'url' => $widget->getUrl()
];
}, $this->dashboardManager->getWidgets());
$configStatuses = $this->config->getUserValue($this->userId, 'dashboard', 'statuses', '{}');
$configStatuses = $this->config->getUserValue($this->userId, 'dashboard', 'statuses', '');
$statuses = json_decode($configStatuses, true);
// We avoid getting an empty array as it will not produce an object in UI's JS
// It does not matter if some statuses are missing from the array, missing ones are considered enabled
$statuses = ($statuses && count($statuses) > 0) ? $statuses : ['weather' => true];
$this->inititalStateService->provideInitialState('dashboard', 'panels', $widgets);
$this->inititalStateService->provideInitialState('dashboard', 'statuses', $statuses);
$this->inititalStateService->provideInitialState('dashboard', 'layout', $userLayout);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment