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

Plugins: Put category and search result breadcrumb always on the 2nd level #79483

Merged
merged 2 commits into from
Jul 18, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Remove logic for reset breadcrumbs on categories pages as it will alw…
…ays be reset
  • Loading branch information
WBerredo committed Jul 17, 2023
commit 92427e5f513e61c81b34fd9ef4f2501c5b94c612
8 changes: 1 addition & 7 deletions client/my-sites/plugins/search-box-header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { setQueryArgs } from 'calypso/lib/query-args';
import scrollTo from 'calypso/lib/scroll-to';
import { useLocalizedPlugins } from 'calypso/my-sites/plugins/utils';
import { recordGoogleEvent } from 'calypso/state/analytics/actions';
import { resetBreadcrumbs } from 'calypso/state/breadcrumb/actions';
import { getSelectedSite } from 'calypso/state/ui/selectors';
import { useTermsSuggestions } from './useTermsSuggestions';
import './style.scss';
Expand All @@ -29,11 +28,6 @@ const SearchBox = ( {

const pageToSearch = useCallback(
( search ) => {
const isCategoryPage = window.location.href.includes( '/plugins/browse/' );
if ( isCategoryPage ) {
dispatch( resetBreadcrumbs() );
}

page.show( localizePath( `/plugins/${ selectedSite?.slug || '' }` ) ); // Ensures location.href is on the main Plugins page before setQueryArgs uses it to construct the redirect.
setQueryArgs( '' !== search ? { s: search } : {} );

Expand All @@ -48,7 +42,7 @@ const SearchBox = ( {
} );
}
},
[ searchBoxRef, categoriesRef, dispatch, selectedSite, localizePath ]
[ searchBoxRef, categoriesRef, selectedSite, localizePath ]
);

const recordSearchEvent = ( eventName ) =>
Expand Down