Ghost/ghost/admin/app/routes/signout.js
Kevin Ansfield 9adbcd1fd0 Match service/controller import to ember-modules-codemod style for consistency
no issue

Automated tools, code generators, and editor integrations are increasingly standardising on the import style used in `ember-modules-codemod`. Our import style differed a little with regards to service/controller injection imports which meant we were starting to see inconsistent naming.
2017-10-30 09:38:01 +00:00

25 lines
680 B
JavaScript

import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import Ember from 'ember';
import styleBody from 'ghost-admin/mixins/style-body';
import {inject as service} from '@ember/service';
// ember-cli-shims doesn't export canInvoke
const {canInvoke} = Ember;
export default AuthenticatedRoute.extend(styleBody, {
titleToken: 'Sign Out',
classNames: ['ghost-signout'],
notifications: service(),
afterModel(model, transition) {
this.get('notifications').clearAll();
if (canInvoke(transition, 'send')) {
transition.send('invalidateSession');
} else {
this.send('invalidateSession');
}
}
});