diff --git a/packages/client/src/pages/PortalSettings/categories/common/index.js b/packages/client/src/pages/PortalSettings/categories/common/index.js index a6f8771d2b..afda2978c2 100644 --- a/packages/client/src/pages/PortalSettings/categories/common/index.js +++ b/packages/client/src/pages/PortalSettings/categories/common/index.js @@ -67,13 +67,6 @@ const TabsCommon = (props) => { } }, [tReady, isLoadedSubmenu]); - const load = async () => { - const currentTab = getCurrentTab(); - await loadBaseInfo( - !isMobileView ? (currentTab === 0 ? "general" : "branding") : "", - ); - }; - const data = [ { id: "general", @@ -92,6 +85,24 @@ const TabsCommon = (props) => { }, ]; + const getCurrentTabId = () => { + const path = location.pathname; + const currentTab = data.find((item) => path.includes(item.id)); + return currentTab !== -1 && data.length ? currentTab.id : data[0].id; + }; + + const currentTabId = getCurrentTabId(); + + const load = async () => { + await loadBaseInfo( + !isMobileView + ? currentTabId === "general" + ? "general" + : "branding" + : "", + ); + }; + const onSelect = (e) => { navigate( combineUrl( @@ -102,14 +113,6 @@ const TabsCommon = (props) => { ); }; - const getCurrentTabId = () => { - const path = location.pathname; - const currentTab = data.find((item) => path.includes(item.id)); - return currentTab !== -1 && data.length ? currentTab.id : data[0].id; - }; - - const currentTabId = getCurrentTabId(); - if (!isLoadedSubmenu) return ; return (