From 084477769c4c2b6624d7ed7efe55a20b235832ef Mon Sep 17 00:00:00 2001 From: Bohdan Garchu Date: Mon, 20 Jan 2025 16:04:29 +0100 Subject: [PATCH] fix: query params don't update on tab switch --- src/app/comparison-portal/layout.tsx | 6 +++--- src/domain/hooks/queryParamsHooks.ts | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/comparison-portal/layout.tsx b/src/app/comparison-portal/layout.tsx index 24d9aa18..9f3806af 100644 --- a/src/app/comparison-portal/layout.tsx +++ b/src/app/comparison-portal/layout.tsx @@ -10,12 +10,12 @@ export const metadata: Metadata = { template: `%s - ${siteConfig.name}`, }, description: - 'Compare real-time global hunger data across different countries and regions. Obtain food insecurity statistics from the WFP Hunger Map Comparison Portal, tailored to various time zones. A valuable resource for humanitarian efforts and research.', + 'Compare real-time global hunger data across different countries and regions. A valuable resource for humanitarian efforts and research.', keywords: siteConfig.keywords, openGraph: { title: `Comparison Portal - ${siteConfig.name}`, description: - 'Compare real-time global hunger data across different countries and regions. Obtain food insecurity statistics from the WFP Hunger Map Comparison Portal, tailored to various time zones. Essential for humanitarian aid and research.', + 'Compare real-time global hunger data across different countries and regions. Essential for humanitarian aid and research.', url: `${siteConfig.domain}/comparison-portal`, images: [ { @@ -31,7 +31,7 @@ export const metadata: Metadata = { card: 'summary_large_image', title: `Comparison Portal - ${siteConfig.name}`, description: - 'Access comparable global hunger data from the WFP Hunger Map Comparison Portal, tailored to different countries and time zones.', + 'Access comparable global hunger data from the WFP Hunger Map Comparison Portal, tailored to different countries and regions.', images: [ { url: '/Images/Comparison-preview.png', diff --git a/src/domain/hooks/queryParamsHooks.ts b/src/domain/hooks/queryParamsHooks.ts index 422fa58b..755b066a 100644 --- a/src/domain/hooks/queryParamsHooks.ts +++ b/src/domain/hooks/queryParamsHooks.ts @@ -59,7 +59,6 @@ export const useSelectedTab = () => { }, [searchParams]); const setSelectedTabFn = (tab: string) => { - setSelectedTab(tab); const updatedParams = new URLSearchParams(searchParams.toString()); if (tab) { updatedParams.set(PARAM_NAME, tab);