Skip to content
Closed
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
Next Next commit
When navigating back from the font sizes panel, the origin and slug n…
…avigation params are not available so let's return early.

Also, remove goTo call in the ScreenHeader onBack callback since back navigation is built into `Navigator.BackButton`
  • Loading branch information
ramonjd committed Oct 2, 2024
commit f38a546175a0a15b262803dd518e23a5e124f8a5
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ function FontSize() {
const {
params: { origin, slug },
goBack,
goTo,
} = useNavigator();

const [ fontSizes, setFontSizes ] = useGlobalSetting(
Expand All @@ -46,6 +45,10 @@ function FontSize() {

const [ globalFluid ] = useGlobalSetting( 'typography.fluid' );

if ( ! origin || ! slug ) {
return;
}

// Get the font sizes from the origin, default to empty array.
const sizes = fontSizes[ origin ] ?? [];

Expand Down Expand Up @@ -151,7 +154,6 @@ function FontSize() {
__( 'Manage the font size %s.' ),
fontSize.name
) }
onBack={ () => goTo( '/typography/font-sizes/' ) }
/>
{ origin === 'custom' && (
<FlexItem>
Expand Down