@@ -49,6 +49,7 @@ import { initApp } from "util/commonUtils";
4949import { favicon } from "assets/images" ;
5050import { hasQueryParam } from "util/urlUtils" ;
5151import { isFetchUserFinished } from "redux/selectors/usersSelectors" ; // getCurrentUser,
52+ import { getIsCommonSettingFetched } from "redux/selectors/commonSettingSelectors" ;
5253import { SystemWarning } from "./components/SystemWarning" ;
5354import { getBrandingConfig } from "./redux/selectors/configSelectors" ;
5455import { buildMaterialPreviewURL } from "./util/materialUtils" ;
@@ -79,6 +80,7 @@ const Wrapper = (props: { children: React.ReactNode, language: string }) => (
7980
8081type AppIndexProps = {
8182 isFetchUserFinished : boolean ;
83+ getIsCommonSettingFetched : boolean ;
8284 currentOrgId ?: string ;
8385 orgDev : boolean ;
8486 defaultHomePage : string | null | undefined ;
@@ -121,7 +123,7 @@ class AppIndex extends React.Component<AppIndexProps, any> {
121123 // persisting the language in local storage
122124 localStorage . setItem ( 'lowcoder_uiLanguage' , this . props . uiLanguage ) ;
123125
124- // console.log("this.props.defaultHomePage: " , this.props.defaultHomePage)
126+ console . log ( 'Props: ' , this . props ) ;
125127
126128 return (
127129 < Wrapper language = { this . props . uiLanguage } >
@@ -272,21 +274,12 @@ class AppIndex extends React.Component<AppIndexProps, any> {
272274 < SystemWarning />
273275 < Router history = { history } >
274276 < Switch >
275- { /*
276- // we decided to show the org homepage in a own navigation page
277- {!this.props.orgDev && !!this.props.defaultHomePage ? (
278- <Redirect exact from={BASE_URL} to={APPLICATION_VIEW_URL(this.props.defaultHomePage, "view")}
279- />
280- ) : (
281- <Redirect exact from={BASE_URL} to={USER_PROFILE_URL} />
282- )}
283- {!this.props.orgDev && !!this.props.defaultHomePage && (
284- <Redirect exact from={ALL_APPLICATIONS_URL} to={APPLICATION_VIEW_URL(this.props.defaultHomePage, "view")}
285- />
286- )} */ }
287-
288- { ! this . props . orgDev ? (
289- < Redirect exact from = { BASE_URL } to = { ORG_HOME_URL } />
277+ { this . props . isFetchUserFinished && ! this . props . orgDev ? (
278+ this . props . getIsCommonSettingFetched && this . props . defaultHomePage !== undefined ? (
279+ < Redirect exact from = { BASE_URL } to = { APPLICATION_VIEW_URL ( this . props . defaultHomePage || "" , "view" ) } />
280+ ) : (
281+ < Redirect exact from = { BASE_URL } to = { ORG_HOME_URL } />
282+ )
290283 ) : (
291284 < Redirect exact from = { BASE_URL } to = { ALL_APPLICATIONS_URL } />
292285 ) }
@@ -377,6 +370,7 @@ class AppIndex extends React.Component<AppIndexProps, any> {
377370
378371const mapStateToProps = ( state : AppState ) => ( {
379372 isFetchUserFinished : isFetchUserFinished ( state ) ,
373+ getIsCommonSettingFetched : getIsCommonSettingFetched ( state ) ,
380374 orgDev : state . ui . users . user . orgDev ,
381375 currentOrgId : state . ui . users . user . currentOrgId ,
382376 defaultHomePage : state . ui . application . homeOrg ?. commonSettings . defaultHomePage ,
0 commit comments