From ae6be0c110dcf150440e9d7af70162b8510736c7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julius=20H=C3=A4rtl?= Date: Fri, 31 Jul 2020 13:27:43 +0200 Subject: [PATCH] Expose firstRun parameter to frontend MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/dashboard/lib/Controller/DashboardController.php | 2 ++ apps/dashboard/src/App.vue | 2 ++ 2 files changed, 4 insertions(+) diff --git a/apps/dashboard/lib/Controller/DashboardController.php b/apps/dashboard/lib/Controller/DashboardController.php index e796ae67ccd..2da01749744 100644 --- a/apps/dashboard/lib/Controller/DashboardController.php +++ b/apps/dashboard/lib/Controller/DashboardController.php @@ -89,6 +89,8 @@ class DashboardController extends Controller { }, $this->dashboardManager->getPanels()); $this->inititalStateService->provideInitialState('dashboard', 'panels', $panels); $this->inititalStateService->provideInitialState('dashboard', 'layout', $userLayout); + $this->inititalStateService->provideInitialState('dashboard', 'firstRun', $this->config->getUserValue($this->userId, 'dashboard', 'firstRun', '1') === '1'); + $this->config->setUserValue($this->userId, 'dashboard', 'firstRun', '0'); if (class_exists(LoadViewer::class)) { $this->eventDispatcher->dispatchTyped(new LoadViewer()); diff --git a/apps/dashboard/src/App.vue b/apps/dashboard/src/App.vue index a87ce343706..f0a47ea535d 100644 --- a/apps/dashboard/src/App.vue +++ b/apps/dashboard/src/App.vue @@ -62,6 +62,7 @@ import axios from '@nextcloud/axios' import { generateUrl } from '@nextcloud/router' const panels = loadState('dashboard', 'panels') +const firstRun = loadState('dashboard', 'firstRun') export default { name: 'App', @@ -74,6 +75,7 @@ export default { timer: new Date(), callbacks: {}, panels, + firstRun, displayName: getCurrentUser()?.displayName, uid: getCurrentUser()?.uid, layout: loadState('dashboard', 'layout').filter((panelId) => panels[panelId]), -- 2.39.5