Skip to content

Commit 1383085

Browse files
jeryjgutenbergplugin
authored andcommitted
Don't subscribe to store unless fitText option is enabled (#72634)
1 parent c7a8088 commit 1383085

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/block-editor/src/hooks/fit-text.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ function useFitText( { fitText, name, clientId } ) {
6666
// Any attribute may change the available space.
6767
const blockAttributes = useSelect(
6868
( select ) => {
69-
if ( ! clientId ) {
69+
if ( ! clientId || ! hasFitTextSupport || ! fitText ) {
7070
return;
7171
}
7272
return select( blockEditorStore ).getBlockAttributes( clientId );
7373
},
74-
[ clientId ]
74+
[ clientId, hasFitTextSupport, fitText ]
7575
);
7676

7777
const applyFitText = useCallback( () => {

0 commit comments

Comments
 (0)