From 97e5fbaa5ee755a7470522ba3f7e67843e9f5371 Mon Sep 17 00:00:00 2001 From: Navin Karkera Date: Tue, 13 May 2025 18:28:51 +0530 Subject: [PATCH] chore: add comment to prevent course search reload on type --- src/course-outline/subsection-card/SubsectionCard.jsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/course-outline/subsection-card/SubsectionCard.jsx b/src/course-outline/subsection-card/SubsectionCard.jsx index 3627b0dfd..95f0b295e 100644 --- a/src/course-outline/subsection-card/SubsectionCard.jsx +++ b/src/course-outline/subsection-card/SubsectionCard.jsx @@ -57,6 +57,11 @@ const SubsectionCard = ({ const [isFormOpen, openForm, closeForm] = useToggle(false); const namePrefix = 'subsection'; const { sharedClipboardData, showPasteUnit } = useClipboard(); + // WARNING: Do not use "useStudioHome" to get "librariesV2Enabled" flag below, + // as it has a useEffect that fetches course waffle flags whenever + // location.search is updated. Course search updates location.search when + // user types, which will then trigger the useEffect and reload the page. + // See https://github.com/openedx/frontend-app-authoring/pull/1938. const { librariesV2Enabled } = useSelector(getStudioHomeData); const [ isAddLibraryUnitModalOpen,