From edc533cc88fbcfda9a746f28f26532ba08af3b31 Mon Sep 17 00:00:00 2001 From: Rish Date: Thu, 25 Feb 2021 14:21:28 +0530 Subject: [PATCH] Added loading/error states for whats new entries refs https://github.com/TryGhost/Team/issues/469 - Adds new loading/error tracked values for whats new entries for error/loading states --- ghost/admin/app/controllers/dashboard.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ghost/admin/app/controllers/dashboard.js b/ghost/admin/app/controllers/dashboard.js index b7afd0ab94..46e7280910 100644 --- a/ghost/admin/app/controllers/dashboard.js +++ b/ghost/admin/app/controllers/dashboard.js @@ -48,6 +48,10 @@ export default class DashboardController extends Controller { @tracked whatsNewEntries = null; + @tracked + whatsNewEntriesLoading = null; + @tracked + whatsNewEntriesError = null; get showTopMembers() { return this.feature.get('emailAnalytics') && this.settings.get('emailTrackOpens'); @@ -212,8 +216,13 @@ export default class DashboardController extends Controller { } loadWhatsNew() { + this.whatsNewEntriesLoading = true; this.whatsNew.fetchLatest.perform().then(() => { + this.whatsNewEntriesLoading = false; this.whatsNewEntries = this.whatsNew.entries.slice(0, 3); + }, (error) => { + this.whatsNewEntriesError = error; + this.whatsNewEntriesLoading = false; }); } }