Skip to content

Commit

Permalink
Close navigation sidebar when all posts clicked (#33393)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-szabo97 authored Jul 14, 2021
1 parent 1813b51 commit 105dc1d
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export default function ContentPostsMenu() {
[ searchQuery ]
);

const { setPage } = useDispatch( editSiteStore );
const { setPage, setIsNavigationPanelOpened } = useDispatch(
editSiteStore
);

const onActivateFrontItem = useCallback( () => {
setPage( {
Expand All @@ -65,7 +67,8 @@ export default function ContentPostsMenu() {
queryContext: { page: 1 },
},
} );
}, [ setPage ] );
setIsNavigationPanelOpened( false );
}, [ setPage, setIsNavigationPanelOpened ] );

const shouldShowLoadingForDebouncing = search && isDebouncing;
const showLoading = ! isResolved || shouldShowLoadingForDebouncing;
Expand Down

0 comments on commit 105dc1d

Please sign in to comment.