mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
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
This commit is contained in:
parent
ceaf54b60e
commit
edc533cc88
1 changed files with 9 additions and 0 deletions
|
@ -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;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue