Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distraction Free: Fix conflict with showListViewByDefault preference #52914

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/edit-post/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ export function initializeEditor(
dispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();

// Check if the block list view should be open by default.
if ( select( editPostStore ).isFeatureActive( 'showListViewByDefault' ) ) {
// If `distractionFree` mode is enabled, the block list view should not be open.
if (
select( editPostStore ).isFeatureActive( 'showListViewByDefault' ) &&
! select( editPostStore ).isFeatureActive( 'distractionFree' )
) {
dispatch( editPostStore ).setIsListViewOpened( true );
}

Expand Down
6 changes: 5 additions & 1 deletion packages/edit-site/src/store/private-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@ export const setCanvasMode =
mode,
} );
// Check if the block list view should be open by default.
// If `distractionFree` mode is enabled, the block list view should not be open.
if (
mode === 'edit' &&
registry
.select( preferencesStore )
.get( 'core/edit-site', 'showListViewByDefault' )
.get( 'core/edit-site', 'showListViewByDefault' ) &&
! registry
.select( preferencesStore )
.get( 'core/edit-site', 'distractionFree' )
) {
dispatch.setIsListViewOpened( true );
}
Expand Down