Skip to content

Commit

Permalink
Change how updating of url is bypassed when switching to focused mode…
Browse files Browse the repository at this point in the history
… editing
  • Loading branch information
glendaviesnz authored and talldan committed Jan 3, 2024
1 parent 9465f9f commit 6bc3abb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/edit-post/src/components/browser-url/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -56,7 +57,8 @@ export class BrowserURL extends Component {
if (
( postId !== prevProps.postId || postId !== historyId ) &&
postStatus !== 'auto-draft' &&
postId
postId &&
! hasHistory
) {
this.setBrowserURL( postId );
}
Expand Down
2 changes: 1 addition & 1 deletion packages/edit-post/src/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ function Layout() {
return (
<>
<FullscreenMode isActive={ isFullscreenActive } />
{ ! hasHistory && <BrowserURL /> }
<BrowserURL hasHistory={ hasHistory } />
<UnsavedChangesWarning />
<AutosaveMonitor />
<LocalAutosaveMonitor />
Expand Down

0 comments on commit 6bc3abb

Please sign in to comment.