From 05d5e12307e71dc51ad88ea162e62aad8b73416b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Wed, 16 Dec 2020 00:14:43 +0100 Subject: [PATCH] Add a condition to change tab --- components/navigasyon.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/navigasyon.js b/components/navigasyon.js index 0183f22..571d364 100644 --- a/components/navigasyon.js +++ b/components/navigasyon.js @@ -74,7 +74,9 @@ export default function Navigasyon({selectedTab}) { const handleChange = (event, newValue) => { setValue(newValue) - router.push(tabRouteHref[newValue], tabRouteAs[newValue]) + if (newValue !== selectedTab) { + router.push(tabRouteHref[newValue], tabRouteAs[newValue]) + } } return (