@@ -39,14 +39,13 @@ import { CodeEditorTooltipContainer } from "base/codeEditor/codeEditor";
3939import { ProductLoading } from "components/ProductLoading" ;
4040import { language , trans } from "i18n" ;
4141import { loadComps } from "comps" ;
42- import { fetchHomeData } from "redux/reduxActions/applicationActions" ;
4342import { initApp } from "util/commonUtils" ;
4443import ApplicationHome from "./pages/ApplicationV2" ;
4544import { favicon } from "@lowcoder-ee/assets/images" ;
4645import { hasQueryParam } from "util/urlUtils" ;
4746import { isFetchUserFinished } from "redux/selectors/usersSelectors" ;
4847import { SystemWarning } from "./components/SystemWarning" ;
49- import { getBrandingConfig , getSystemConfigFetching } from "./redux/selectors/configSelectors" ;
48+ import { getBrandingConfig } from "./redux/selectors/configSelectors" ;
5049import { buildMaterialPreviewURL } from "./util/materialUtils" ;
5150import GlobalInstances from 'components/GlobalInstances' ;
5251
@@ -71,35 +70,22 @@ const Wrapper = (props: { children: React.ReactNode }) => (
7170
7271type AppIndexProps = {
7372 isFetchUserFinished : boolean ;
74- isFetchHomeFinished : boolean ;
75- // isFetchingConfig: boolean;
7673 currentOrgId ?: string ;
7774 orgDev : boolean ;
7875 defaultHomePage : string | null | undefined ;
7976 fetchConfig : ( orgId ?: string ) => void ;
8077 getCurrentUser : ( ) => void ;
81- fetchHome : ( ) => void ;
8278 favicon : string ;
8379 brandName : string ;
8480} ;
8581
8682class AppIndex extends React . Component < AppIndexProps , any > {
8783 componentDidMount ( ) {
8884 this . props . getCurrentUser ( ) ;
89- const { pathname } = history . location ;
90-
91- this . props . fetchConfig ( this . props . currentOrgId ) ;
92-
93- if ( pathname === BASE_URL ) {
94- this . props . fetchHome ( ) ;
95- }
9685 }
9786
9887 componentDidUpdate ( prevProps : AppIndexProps ) {
99- if ( history . location . pathname === BASE_URL ) {
100- this . props . fetchHome ( ) ;
101- }
102- if ( prevProps . currentOrgId !== this . props . currentOrgId ) {
88+ if ( prevProps . currentOrgId !== this . props . currentOrgId && this . props . currentOrgId !== '' ) {
10389 this . props . fetchConfig ( this . props . currentOrgId ) ;
10490 }
10591 }
@@ -108,11 +94,7 @@ class AppIndex extends React.Component<AppIndexProps, any> {
10894 const isTemplate = hasQueryParam ( "template" ) ;
10995 const pathname = history . location . pathname ;
11096 // make sure all users in this app have checked login info
111- if (
112- ! this . props . isFetchUserFinished ||
113- // this.props.isFetchingConfig ||
114- ( pathname === BASE_URL && ! this . props . isFetchHomeFinished )
115- ) {
97+ if ( ! this . props . isFetchUserFinished ) {
11698 const hideLoadingHeader = isTemplate || isAuthUnRequired ( pathname ) ;
11799 return < ProductLoading hideHeader = { hideLoadingHeader } /> ;
118100 }
@@ -185,11 +167,9 @@ class AppIndex extends React.Component<AppIndexProps, any> {
185167
186168const mapStateToProps = ( state : AppState ) => ( {
187169 isFetchUserFinished : isFetchUserFinished ( state ) ,
188- // isFetchingConfig: getSystemConfigFetching(state),
189170 orgDev : state . ui . users . user . orgDev ,
190171 currentOrgId : state . ui . users . user . currentOrgId ,
191172 defaultHomePage : state . ui . application . homeOrg ?. commonSettings . defaultHomePage ,
192- isFetchHomeFinished : state . ui . application . loadingStatus . fetchHomeDataFinished ,
193173 favicon : getBrandingConfig ( state ) ?. favicon
194174 ? buildMaterialPreviewURL ( getBrandingConfig ( state ) ?. favicon ! )
195175 : favicon ,
@@ -201,7 +181,6 @@ const mapDispatchToProps = (dispatch: any) => ({
201181 dispatch ( fetchUserAction ( ) ) ;
202182 } ,
203183 fetchConfig : ( orgId ?: string ) => dispatch ( fetchConfigAction ( orgId ) ) ,
204- fetchHome : ( ) => dispatch ( fetchHomeData ( { } ) ) ,
205184} ) ;
206185
207186const AppIndexWithProps = connect ( mapStateToProps , mapDispatchToProps ) ( AppIndex ) ;
0 commit comments