Skip to content

Commit

Permalink
Site Editor: Keep edited entity in sync when Editor canvas isn't moun…
Browse files Browse the repository at this point in the history
…ted (#46524)
  • Loading branch information
Mamaduka authored Dec 14, 2022
1 parent 8260345 commit a3db417
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 0 additions & 4 deletions packages/edit-site/src/components/editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import { SidebarComplementaryAreaFills } from '../sidebar-edit-mode';
import BlockEditor from '../block-editor';
import CodeEditor from '../code-editor';
import KeyboardShortcuts from '../keyboard-shortcuts';
import useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';
import InserterSidebar from '../secondary-sidebar/inserter-sidebar';
import ListViewSidebar from '../secondary-sidebar/list-view-sidebar';
import WelcomeGuide from '../welcome-guide';
Expand All @@ -52,9 +51,6 @@ const interfaceLabels = {
};

export default function Editor() {
// This ensures the edited entity id and type are initialized properly.
useInitEditedEntityFromURL();

const {
editedPostId,
editedPostType,
Expand Down
4 changes: 4 additions & 0 deletions packages/edit-site/src/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ import getIsListPage from '../../utils/get-is-list-page';
import Header from '../header-edit-mode';
import SiteIcon from '../site-icon';
import SiteTitle from '../site-title';
import useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';

const ANIMATION_DURATION = 0.5;

export default function Layout( { onError } ) {
// This ensures the edited entity id and type are initialized properly.
useInitEditedEntityFromURL();

const { params } = useLocation();
const isListPage = getIsListPage( params );
const isEditorPage = ! isListPage;
Expand Down

0 comments on commit a3db417

Please sign in to comment.