0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Fixed broken loading state on transition between posts in editor (#1021)

closes https://github.com/TryGhost/Ghost/issues/9582
- clear the `post` model on the `editor` controller when swapping models to avoid the editor contents and the editor loading state being displayed simultaneously
This commit is contained in:
Abdullah Samman 2018-06-04 11:46:49 +03:00 committed by Kevin Ansfield
parent ab5267ab87
commit 033ec0ce1a

View file

@ -1,6 +1,18 @@
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
export default AuthenticatedRoute.extend({
beforeModel(transition) {
this._super(...arguments);
// if the transition is not new->edit, reset the post on the controller
// so that the editor view is cleared before showing the loading state
if (transition.urlMethod !== 'replace') {
let editor = this.controllerFor('editor');
editor.set('post', null);
editor.reset();
}
},
model(params) {
let query = {
id: params.post_id,