@@ -49,6 +49,7 @@ import { initApp } from "util/commonUtils";
49
49
import { favicon } from "assets/images" ;
50
50
import { hasQueryParam } from "util/urlUtils" ;
51
51
import { isFetchUserFinished } from "redux/selectors/usersSelectors" ; // getCurrentUser,
52
+ import { getIsCommonSettingFetched } from "redux/selectors/commonSettingSelectors" ;
52
53
import { SystemWarning } from "./components/SystemWarning" ;
53
54
import { getBrandingConfig } from "./redux/selectors/configSelectors" ;
54
55
import { buildMaterialPreviewURL } from "./util/materialUtils" ;
@@ -79,6 +80,7 @@ const Wrapper = (props: { children: React.ReactNode, language: string }) => (
79
80
80
81
type AppIndexProps = {
81
82
isFetchUserFinished : boolean ;
83
+ getIsCommonSettingFetched : boolean ;
82
84
currentOrgId ?: string ;
83
85
orgDev : boolean ;
84
86
defaultHomePage : string | null | undefined ;
@@ -121,7 +123,7 @@ class AppIndex extends React.Component<AppIndexProps, any> {
121
123
// persisting the language in local storage
122
124
localStorage . setItem ( 'lowcoder_uiLanguage' , this . props . uiLanguage ) ;
123
125
124
- // console.log("this.props.defaultHomePage: " , this.props.defaultHomePage)
126
+ console . log ( 'Props: ' , this . props ) ;
125
127
126
128
return (
127
129
< Wrapper language = { this . props . uiLanguage } >
@@ -272,21 +274,12 @@ class AppIndex extends React.Component<AppIndexProps, any> {
272
274
< SystemWarning />
273
275
< Router history = { history } >
274
276
< 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
+ )
290
283
) : (
291
284
< Redirect exact from = { BASE_URL } to = { ALL_APPLICATIONS_URL } />
292
285
) }
@@ -377,6 +370,7 @@ class AppIndex extends React.Component<AppIndexProps, any> {
377
370
378
371
const mapStateToProps = ( state : AppState ) => ( {
379
372
isFetchUserFinished : isFetchUserFinished ( state ) ,
373
+ getIsCommonSettingFetched : getIsCommonSettingFetched ( state ) ,
380
374
orgDev : state . ui . users . user . orgDev ,
381
375
currentOrgId : state . ui . users . user . currentOrgId ,
382
376
defaultHomePage : state . ui . application . homeOrg ?. commonSettings . defaultHomePage ,
0 commit comments