This commit is contained in:
Joshua T Flowers 2019-07-23 11:17:43 +08:00 committed by GitHub
parent 646235ac7b
commit 9f6e200ab7
1 changed files with 5 additions and 1 deletions

View File

@ -92,7 +92,11 @@ export function getSearchWords( query = navUtils.getQuery() ) {
* @return {String} Updated URL merging query params into existing params.
*/
export function getNewPath( query, path = getPath(), currentQuery = getQuery() ) {
return addQueryArgs( 'admin.php', { page: 'wc-admin', path, ...currentQuery, ...query } );
const args = { page: 'wc-admin', ...currentQuery, ...query };
if ( '/' !== path ) {
args.path = path;
}
return addQueryArgs( 'admin.php', args );
}
/**