From db3b743d71f6364dbfb094b66f57af9a66bd0f74 Mon Sep 17 00:00:00 2001 From: Alexandre Fauquette <45398769+alexfauquette@users.noreply.github.com> Date: Sat, 21 Dec 2024 15:28:43 +0100 Subject: [PATCH] fix: Prevent global country update to go back to home page (#1113) --- src/components/Footer/DownloadOpenFoodFacts.jsx | 2 +- src/contexts/CountryProvider/CountryProvider.tsx | 3 ++- src/pages/ingredients/IngeredientDisplay.tsx | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Footer/DownloadOpenFoodFacts.jsx b/src/components/Footer/DownloadOpenFoodFacts.jsx index 165ecb1d44..8c2cf73ac0 100644 --- a/src/components/Footer/DownloadOpenFoodFacts.jsx +++ b/src/components/Footer/DownloadOpenFoodFacts.jsx @@ -46,7 +46,7 @@ export default function DownloadOpenFoodFacts() { {footerLinks.map((link) => { return ( { prev.set("country", newCountry); + return prev; }); }, - [], + [setSearchParams], ); const value = React.useMemo(() => { diff --git a/src/pages/ingredients/IngeredientDisplay.tsx b/src/pages/ingredients/IngeredientDisplay.tsx index 8cccb7a5d7..d4b9fdb410 100644 --- a/src/pages/ingredients/IngeredientDisplay.tsx +++ b/src/pages/ingredients/IngeredientDisplay.tsx @@ -1,5 +1,4 @@ import * as React from "react"; - import Button from "@mui/material/Button"; import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography";