Skip to content
Merged
Show file tree
Hide file tree
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
Fix: Shadow/Font size preset panel crashes the editor
  • Loading branch information
t-hamano committed Oct 1, 2024
commit d467684ecedfd3ca01e6f0765f191e62a38fb5c5
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ function FontSize() {

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

if ( ! origin || ! slug ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nice! I promise I didn't steal this for #65811

😆

return null;
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ export default function ShadowsEditPanel() {
const [ isRenameModalVisible, setIsRenameModalVisible ] = useState( false );
const [ shadowName, setShadowName ] = useState( selectedShadow.name );

if ( ! category || ! slug ) {
return null;
}

const onShadowChange = ( shadow ) => {
setSelectedShadow( { ...selectedShadow, shadow } );
const updatedShadows = shadows.map( ( s ) =>
Expand Down