From e55d06579170adade678bf136aa910d38d4b8580 Mon Sep 17 00:00:00 2001 From: Ella Date: Thu, 14 Nov 2024 11:20:56 +0100 Subject: [PATCH] Remove unneeded changes --- .../interface/src/components/complementary-area/index.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/interface/src/components/complementary-area/index.js b/packages/interface/src/components/complementary-area/index.js index 4fe749655f756e..af56cf0c1755e1 100644 --- a/packages/interface/src/components/complementary-area/index.js +++ b/packages/interface/src/components/complementary-area/index.js @@ -233,7 +233,6 @@ function ComplementaryArea( { isActive, isSmall ); - const { getActiveComplementaryArea } = useSelect( interfaceStore ); const { enableComplementaryArea, disableComplementaryArea, @@ -242,24 +241,22 @@ function ComplementaryArea( { } = useDispatch( interfaceStore ); useEffect( () => { - // Make sure we have the latest active area. - const freshActiveArea = getActiveComplementaryArea( scope ); // Set initial visibility: For large screens, enable if it's active by // default. For small screens, always initially disable. - if ( isActiveByDefault && freshActiveArea === undefined && ! isSmall ) { + if ( isActiveByDefault && activeArea === undefined && ! isSmall ) { enableComplementaryArea( scope, identifier ); - } else if ( freshActiveArea === undefined && isSmall ) { + } else if ( activeArea === undefined && isSmall ) { disableComplementaryArea( scope, identifier ); } setIsReady( true ); }, [ + activeArea, isActiveByDefault, scope, identifier, isSmall, enableComplementaryArea, disableComplementaryArea, - getActiveComplementaryArea, ] ); if ( ! isReady ) {