From ce92570d2ef44139fa0baec805cf03a0e8e4e336 Mon Sep 17 00:00:00 2001 From: Anna Beddow Date: Wed, 22 Jan 2025 16:30:59 +0000 Subject: [PATCH] Add further comments --- .../src/components/ShowHideContainers.importable.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dotcom-rendering/src/components/ShowHideContainers.importable.tsx b/dotcom-rendering/src/components/ShowHideContainers.importable.tsx index 2cb84267cc..b91cb77115 100644 --- a/dotcom-rendering/src/components/ShowHideContainers.importable.tsx +++ b/dotcom-rendering/src/components/ShowHideContainers.importable.tsx @@ -93,6 +93,10 @@ export const ShowHideContainers = () => { ); for (const button of showHideButtons) { + /** + * We need if a user is signed in before we can make any further decisions about show/hide buttons. + * If the state is still pending, return early to prevent any flickering of the buttons. + */ if (isSignedIn === 'Pending') return; const sectionId = button.getAttribute('data-show-hide-button');