handle query omission
This commit is contained in:
parent
802d8b853c
commit
ee7f1935c4
|
@ -56,7 +56,6 @@ const removeSettingsScripts = ( scripts ) => {
|
|||
};
|
||||
|
||||
const Settings = ( { params } ) => {
|
||||
console.log( params );
|
||||
useFullScreen( [ 'woocommerce-settings' ] );
|
||||
const settingsData = window.wcSettings?.admin?.settingsPages;
|
||||
const sections = settingsData[ params.page ]?.sections;
|
||||
|
|
|
@ -7,7 +7,9 @@ import { getNewPath, navigateTo } from '@woocommerce/navigation';
|
|||
export const Tabs = ( { data, page, children } ) => {
|
||||
const onSelect = ( tabName ) => {
|
||||
const url = getNewPath( {}, `/settings/${ tabName }`, {} );
|
||||
navigateTo( { url } );
|
||||
if ( page !== tabName ) {
|
||||
navigateTo( { url } );
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
|
@ -22,6 +24,7 @@ export const Tabs = ( { data, page, children } ) => {
|
|||
name: key,
|
||||
title: data[ key ].label,
|
||||
} ) ) }
|
||||
selectOnMove={ false }
|
||||
>
|
||||
{ () => <div>{ children }</div> }
|
||||
</TabPanel>
|
||||
|
|
|
@ -173,7 +173,7 @@ if ( ! class_exists( 'WC_Settings_Page', false ) ) :
|
|||
$tags = new WP_HTML_Tag_Processor( $html );
|
||||
while( $tags->next_tag( array( 'tag_name' => 'script' ) ) ) {
|
||||
$script_type = $tags->get_attribute( 'type' );
|
||||
if ( 'text/html' !== $script_type ) {
|
||||
if ( 'text/javascript' === $script_type ) {
|
||||
$script_contents = $tags->get_modifiable_text();
|
||||
$section_settings_data[] = array(
|
||||
'type' => 'script',
|
||||
|
|
Loading…
Reference in New Issue