Client:Pages:PortalSettigs: add a check for data in tabs
This commit is contained in:
parent
baec28ed6e
commit
bcf23b865e
@ -105,7 +105,7 @@ const TabsCommon = (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();
|
||||
|
@ -122,7 +122,7 @@ const DataManagementWrapper = (props) => {
|
||||
useEffect(() => {
|
||||
const path = location.pathname;
|
||||
const currentTab = data.find((item) => path.includes(item.id));
|
||||
if (currentTab !== -1) setCurrentTabId(currentTab.id);
|
||||
if (currentTab !== -1 && data.length) setCurrentTabId(currentTab.id);
|
||||
|
||||
setIsLoading(true);
|
||||
}, [location]);
|
||||
|
@ -61,7 +61,7 @@ const DeleteData = (props) => {
|
||||
useEffect(() => {
|
||||
const path = location.pathname;
|
||||
const currentTab = data.find((item) => path.includes(item.id));
|
||||
if (currentTab !== -1) setCurrentTabId(currentTab.id);
|
||||
if (currentTab !== -1 && data.length) setCurrentTabId(currentTab.id);
|
||||
|
||||
setIsLoading(true);
|
||||
}, [location]);
|
||||
|
@ -116,7 +116,7 @@ const DeveloperToolsWrapper = (props) => {
|
||||
useEffect(() => {
|
||||
const path = location.pathname;
|
||||
const currentTab = data.find((item) => path.includes(item.id));
|
||||
if (currentTab !== -1) {
|
||||
if (currentTab !== -1 && data.length) {
|
||||
setCurrentTabId(currentTab.id);
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ const IntegrationWrapper = (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