From fb1dda10195a45082be049f70d0481ec3f9d0aa2 Mon Sep 17 00:00:00 2001 From: Daniel Valenzuela Date: Fri, 22 Nov 2024 22:54:40 -0300 Subject: [PATCH] fix: avoid changing url when removing filters --- src/library-authoring/LibraryAuthoringPage.tsx | 2 +- src/search-manager/SearchManager.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/library-authoring/LibraryAuthoringPage.tsx b/src/library-authoring/LibraryAuthoringPage.tsx index 202581e504..76cef54178 100644 --- a/src/library-authoring/LibraryAuthoringPage.tsx +++ b/src/library-authoring/LibraryAuthoringPage.tsx @@ -148,7 +148,7 @@ const LibraryAuthoringPage = ({ returnToLibrarySelection }: LibraryAuthoringPage } else if (currentPath && currentPath in ContentType) { setActiveKey(ContentType[currentPath]); } - }, [location.pathname]); + }, []); useEffect(() => { if (!componentPickerMode) { diff --git a/src/search-manager/SearchManager.ts b/src/search-manager/SearchManager.ts index 3776aaa30a..314c90020a 100644 --- a/src/search-manager/SearchManager.ts +++ b/src/search-manager/SearchManager.ts @@ -147,7 +147,9 @@ export const SearchContextProvider: React.FC<{ setBlockTypesFilter([]); setTagsFilter([]); setProblemTypesFilter([]); - setUsageKey(''); + if (usageKey !== '') { + setUsageKey(''); + } }, []); // Initialize a connection to Meilisearch: