Client:Pages:Profile: add a check for data in tabs
This commit is contained in:
parent
f95ec34dc1
commit
e31496aac2
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user