0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00
ghost/core/client/app/routes/about.js

37 lines
883 B
JavaScript
Raw Normal View History

import Ember from 'ember';
import AuthenticatedRoute from 'ghost/routes/authenticated';
import styleBody from 'ghost/mixins/style-body';
2016-01-19 07:03:27 -06:00
const {
inject: {service}
} = Ember;
export default AuthenticatedRoute.extend(styleBody, {
titleToken: 'About',
classNames: ['view-about'],
2016-01-19 07:03:27 -06:00
ghostPaths: service(),
ajax: service(),
cachedConfig: false,
model() {
let cachedConfig = this.get('cachedConfig');
let configUrl = this.get('ghostPaths.url').api('configuration', 'about');
if (cachedConfig) {
return cachedConfig;
}
2016-01-18 09:37:14 -06:00
return this.get('ajax').request(configUrl)
.then((configurationResponse) => {
let [cachedConfig] = configurationResponse.configuration;
this.set('cachedConfig', cachedConfig);
return cachedConfig;
});
}
});