diff --git a/ghost/admin/app/controllers/editor.js b/ghost/admin/app/controllers/editor.js index 2ba04ed890..fb4a56f5c6 100644 --- a/ghost/admin/app/controllers/editor.js +++ b/ghost/admin/app/controllers/editor.js @@ -788,6 +788,14 @@ export default class EditorController extends Controller { this._koenig.cleanup(); } + // user can enter the slug name and then leave the post page, + // in such case we should wait until the slug would be saved on backend + if (this.updateSlugTask.isRunning) { + transition.abort(); + await this.updateSlugTask.last; + return transition.retry(); + } + let hasDirtyAttributes = this.hasDirtyAttributes; let state = post.getProperties('isDeleted', 'isSaving', 'hasDirtyAttributes', 'isNew'); diff --git a/ghost/admin/app/controllers/lexical-editor.js b/ghost/admin/app/controllers/lexical-editor.js index 2e113d078e..d4fcb6304e 100644 --- a/ghost/admin/app/controllers/lexical-editor.js +++ b/ghost/admin/app/controllers/lexical-editor.js @@ -791,6 +791,14 @@ export default class LexicalEditorController extends Controller { // this._koenig.cleanup(); // } + // user can enter the slug name and then leave the post page, + // in such case we should wait until the slug would be saved on backend + if (this.updateSlugTask.isRunning) { + transition.abort(); + await this.updateSlugTask.last; + return transition.retry(); + } + let hasDirtyAttributes = this.hasDirtyAttributes; let state = post.getProperties('isDeleted', 'isSaving', 'hasDirtyAttributes', 'isNew');