Reset url state on tab click

This commit is contained in:
Bero 2023-10-04 19:37:41 +02:00
parent d8adecf783
commit a8cf772aaf
1 changed files with 5 additions and 7 deletions

View File

@ -60,14 +60,12 @@ const tabs: Tabs = {
};
const setUrlTabParam = ( tabKey: string ) => {
if ( tabKey === DEFAULT_TAB_KEY ) {
navigateTo( {
url: getNewPath( {}, MARKETPLACE_PATH, {} ),
} );
return;
}
navigateTo( {
url: getNewPath( { tab: tabKey } ),
url: getNewPath(
{ tab: tabKey === DEFAULT_TAB_KEY ? undefined : tabKey },
MARKETPLACE_PATH,
{}
),
} );
};