diff --git a/src/containers/my-cooperations/cooperation-details/CooperationDetails.tsx b/src/containers/my-cooperations/cooperation-details/CooperationDetails.tsx index 81d8c0892..796d242f9 100644 --- a/src/containers/my-cooperations/cooperation-details/CooperationDetails.tsx +++ b/src/containers/my-cooperations/cooperation-details/CooperationDetails.tsx @@ -61,13 +61,15 @@ const CooperationDetails = () => { const isTabInSearchParams = Object.values(CooperationTabsEnum).includes(tab) - const activeTab = isTabInSearchParams ? tab : CooperationTabsEnum.Activities + const defaultTab = CooperationTabsEnum.Activities + + const activeTab = isTabInSearchParams ? tab : defaultTab useEffect(() => { if (!isTabInSearchParams) { - setSearchParams({ tab: CooperationTabsEnum.Activities }) + setSearchParams({ tab: defaultTab }) } - }, [isTabInSearchParams, setSearchParams]) + }, [defaultTab, isTabInSearchParams, setSearchParams]) const responseError = useCallback( () => navigate(errorRoutes.notFound.path),