From 8fabb14037afcf8518121316ca2e164a65fe8765 Mon Sep 17 00:00:00 2001 From: Laura Perry <10005215+lperry25@users.noreply.github.com> Date: Fri, 22 Nov 2024 14:16:16 +0100 Subject: [PATCH] remove console logs and unused code --- src/App/libs/provider/reducer.js | 13 ------------- src/App/pages/search/search-sources.js | 3 --- 2 files changed, 16 deletions(-) diff --git a/src/App/libs/provider/reducer.js b/src/App/libs/provider/reducer.js index 8ef9f45..6e9c29b 100644 --- a/src/App/libs/provider/reducer.js +++ b/src/App/libs/provider/reducer.js @@ -22,12 +22,6 @@ export function createStore(set) { }; } -function toggleOption(allOptions, current, item) { - return allOptions - .map(({ id }) => id) - .filter((id) => (id === item) !== current.includes(id)); -} - function setFilters(state, filters) { return Object.entries(filters).reduce((result, [key, value]) => { switch (key) { @@ -58,13 +52,6 @@ function toggleNamespace(state, namespace) { ); } return setNamespaces(state, [namespace]); - let namespaces = toggleOption(ALL_NAMESPACES, state.namespaces, namespace); - console.log({ namespaces }); - if (namespaces.length === 0) - namespaces = ALL_NAMESPACES.map(({ id }) => id).filter( - (id) => id !== namespace, - ); - return setNamespaces(state, namespaces); } function summaryAppend(state, summary) { diff --git a/src/App/pages/search/search-sources.js b/src/App/pages/search/search-sources.js index da45add..65024dc 100644 --- a/src/App/pages/search/search-sources.js +++ b/src/App/pages/search/search-sources.js @@ -10,9 +10,7 @@ function Source({ id, icon, name, selectedTab }) { const tabRef = useRef(null); useEffect(() => { - console.log({ selectedTab, id }); if (selectedTab === id) { - console.log('scroll'); tabRef?.current?.scrollIntoView({ behavior: 'smooth', block: 'center', @@ -35,7 +33,6 @@ function Source({ id, icon, name, selectedTab }) { export function SearchSources() { const location = useLocation(); const { namespaces } = parseUrlParams(location.search); - console.log({ namespaces }); const defaultValue = namespaces?.length === 1 ? namespaces[0] : 'all'; return (