mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-20 01:03:23 +03:00
8502ebb96a
refs: https://github.com/TryGhost/Team/issues/1631 Co-authored-by: James Morris <moreofmorris@users.noreply.github.com>
25 lines
653 B
JavaScript
25 lines
653 B
JavaScript
import Component from '@glimmer/component';
|
|
import {action} from '@ember/object';
|
|
import {inject as service} from '@ember/service';
|
|
import {tracked} from '@glimmer/tracking';
|
|
|
|
export default class WhatsNew extends Component {
|
|
@service whatsNew;
|
|
|
|
@tracked entries = null;
|
|
@tracked loading = null;
|
|
@tracked error = null;
|
|
|
|
@action
|
|
load() {
|
|
this.loading = true;
|
|
this.whatsNew.fetchLatest.perform().then(() => {
|
|
this.loading = false;
|
|
this.entries = this.whatsNew.entries.slice(0, 3);
|
|
}, (error) => {
|
|
this.error = error;
|
|
this.loading = false;
|
|
});
|
|
}
|
|
}
|