Client:Pages:Profile: add a check for data in tabs

This commit is contained in:
Darya Umrikhina 2024-06-13 16:18:44 +07:00
parent f95ec34dc1
commit e31496aac2

View File

@ -94,7 +94,7 @@ const SectionBodyContent = (props) => {
const getCurrentTabId = () => {
const path = location.pathname;
const currentTab = data.find((item) => path.includes(item.id));
return currentTab !== -1 ? currentTab.id : data[0].id;
return currentTab !== -1 && data.length ? currentTab.id : data[0].id;
};
const currentTabId = getCurrentTabId();