Skip to content

Commit

Permalink
Skip updating the layout URL param if type is list and layout undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Aug 2, 2024
1 parent 6aae380 commit 6958d22
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/edit-site/src/components/post-list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ function useView( postType ) {
( newView ) => {
const { params } = history.getLocationWithParams();

if ( newView.type !== params?.layout ) {
if ( newView.type === LAYOUT_LIST && ! params?.layout ) {
// Skip updating the layout URL param if
// it is not present and the newView.type is LAYOUT_LIST.
} else if ( newView.type !== params?.layout ) {
history.push( {
...params,
layout: newView.type,
Expand Down

0 comments on commit 6958d22

Please sign in to comment.