mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 14:03:48 +03:00
05a3a11855
refs https://github.com/TryGhost/Ghost/issues/5168 - adds a `tour` service that handles syncing and management of tour throbbers & content - adds a `gh-tour-item` component that handles the display of a throbber and it's associated popover when clicked - uses settings API endpoint to populate viewed tour items on app boot/signin - adds `liquid-tether@2.0.3` dependency for attaching throbbers and popups - adds initial tour contents
29 lines
841 B
JavaScript
29 lines
841 B
JavaScript
import RSVP from 'rsvp';
|
|
import SessionService from 'ember-simple-auth/services/session';
|
|
import computed from 'ember-computed';
|
|
import injectService from 'ember-service/inject';
|
|
|
|
export default SessionService.extend({
|
|
feature: injectService(),
|
|
store: injectService(),
|
|
tour: injectService(),
|
|
|
|
user: computed(function () {
|
|
return this.get('store').queryRecord('user', {id: 'me'});
|
|
}),
|
|
|
|
authenticate() {
|
|
return this._super(...arguments).then((authResult) => {
|
|
// TODO: remove duplication with application.afterModel
|
|
let preloadPromises = [
|
|
this.get('feature').fetch(),
|
|
this.get('tour').fetchViewed()
|
|
];
|
|
|
|
return RSVP.all(preloadPromises).then(() => {
|
|
return authResult;
|
|
});
|
|
});
|
|
}
|
|
});
|