mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-04 17:04:59 +03:00
9adbcd1fd0
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.
25 lines
680 B
JavaScript
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');
|
|
}
|
|
}
|
|
});
|