From 6bc3abbcb07f1998e93a1a4d0928cae7b154c142 Mon Sep 17 00:00:00 2001 From: Glen Davies Date: Fri, 22 Dec 2023 11:54:53 +1300 Subject: [PATCH] Change how updating of url is bypassed when switching to focused mode editing --- packages/edit-post/src/components/browser-url/index.js | 6 ++++-- packages/edit-post/src/components/layout/index.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/edit-post/src/components/browser-url/index.js b/packages/edit-post/src/components/browser-url/index.js index 798753cfea357a..5f389c4c82818f 100644 --- a/packages/edit-post/src/components/browser-url/index.js +++ b/packages/edit-post/src/components/browser-url/index.js @@ -43,7 +43,8 @@ export class BrowserURL extends Component { } componentDidUpdate( prevProps ) { - const { postId, postStatus, postType, isSavingPost } = this.props; + const { postId, postStatus, postType, isSavingPost, hasHistory } = + this.props; const { historyId } = this.state; // Posts are still dirty while saving so wait for saving to finish @@ -56,7 +57,8 @@ export class BrowserURL extends Component { if ( ( postId !== prevProps.postId || postId !== historyId ) && postStatus !== 'auto-draft' && - postId + postId && + ! hasHistory ) { this.setBrowserURL( postId ); } diff --git a/packages/edit-post/src/components/layout/index.js b/packages/edit-post/src/components/layout/index.js index 72b843f06e7433..785f329cd34668 100644 --- a/packages/edit-post/src/components/layout/index.js +++ b/packages/edit-post/src/components/layout/index.js @@ -288,7 +288,7 @@ function Layout() { return ( <> - { ! hasHistory && } +