mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Fixed console error when leaving new post screen with beta editor (#17928)
no issue - when a post is new it has no revisions but in the `willTransition` hook we were using `lastRevision.get` even though `lastRevision` was null - adjusted the `hasChangedSinceLastRevision` conditional to always be `false` for new posts
This commit is contained in:
parent
a4f6a33fee
commit
d67a7bdc58
1 changed files with 1 additions and 1 deletions
|
@ -954,7 +954,7 @@ export default class LexicalEditorController extends Controller {
|
|||
// Check if anything has changed since the last revision
|
||||
let postRevisions = post.get('postRevisions').toArray();
|
||||
let latestRevision = postRevisions[postRevisions.length - 1];
|
||||
let hasChangedSinceLastRevision = post.get('lexical') !== latestRevision.get('lexical');
|
||||
let hasChangedSinceLastRevision = !post.isNew && post.lexical !== latestRevision.lexical;
|
||||
|
||||
let fromNewToEdit = this.router.currentRouteName === 'lexical-editor.new'
|
||||
&& transition.targetName === 'lexical-editor.edit'
|
||||
|
|
Loading…
Add table
Reference in a new issue