@@ -39,14 +39,13 @@ import { CodeEditorTooltipContainer } from "base/codeEditor/codeEditor";
39
39
import { ProductLoading } from "components/ProductLoading" ;
40
40
import { language , trans } from "i18n" ;
41
41
import { loadComps } from "comps" ;
42
- import { fetchHomeData } from "redux/reduxActions/applicationActions" ;
43
42
import { initApp } from "util/commonUtils" ;
44
43
import ApplicationHome from "./pages/ApplicationV2" ;
45
44
import { favicon } from "@lowcoder-ee/assets/images" ;
46
45
import { hasQueryParam } from "util/urlUtils" ;
47
46
import { isFetchUserFinished } from "redux/selectors/usersSelectors" ;
48
47
import { SystemWarning } from "./components/SystemWarning" ;
49
- import { getBrandingConfig , getSystemConfigFetching } from "./redux/selectors/configSelectors" ;
48
+ import { getBrandingConfig } from "./redux/selectors/configSelectors" ;
50
49
import { buildMaterialPreviewURL } from "./util/materialUtils" ;
51
50
import GlobalInstances from 'components/GlobalInstances' ;
52
51
@@ -71,35 +70,22 @@ const Wrapper = (props: { children: React.ReactNode }) => (
71
70
72
71
type AppIndexProps = {
73
72
isFetchUserFinished : boolean ;
74
- isFetchHomeFinished : boolean ;
75
- // isFetchingConfig: boolean;
76
73
currentOrgId ?: string ;
77
74
orgDev : boolean ;
78
75
defaultHomePage : string | null | undefined ;
79
76
fetchConfig : ( orgId ?: string ) => void ;
80
77
getCurrentUser : ( ) => void ;
81
- fetchHome : ( ) => void ;
82
78
favicon : string ;
83
79
brandName : string ;
84
80
} ;
85
81
86
82
class AppIndex extends React . Component < AppIndexProps , any > {
87
83
componentDidMount ( ) {
88
84
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
- }
96
85
}
97
86
98
87
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 !== '' ) {
103
89
this . props . fetchConfig ( this . props . currentOrgId ) ;
104
90
}
105
91
}
@@ -108,11 +94,7 @@ class AppIndex extends React.Component<AppIndexProps, any> {
108
94
const isTemplate = hasQueryParam ( "template" ) ;
109
95
const pathname = history . location . pathname ;
110
96
// 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 ) {
116
98
const hideLoadingHeader = isTemplate || isAuthUnRequired ( pathname ) ;
117
99
return < ProductLoading hideHeader = { hideLoadingHeader } /> ;
118
100
}
@@ -185,11 +167,9 @@ class AppIndex extends React.Component<AppIndexProps, any> {
185
167
186
168
const mapStateToProps = ( state : AppState ) => ( {
187
169
isFetchUserFinished : isFetchUserFinished ( state ) ,
188
- // isFetchingConfig: getSystemConfigFetching(state),
189
170
orgDev : state . ui . users . user . orgDev ,
190
171
currentOrgId : state . ui . users . user . currentOrgId ,
191
172
defaultHomePage : state . ui . application . homeOrg ?. commonSettings . defaultHomePage ,
192
- isFetchHomeFinished : state . ui . application . loadingStatus . fetchHomeDataFinished ,
193
173
favicon : getBrandingConfig ( state ) ?. favicon
194
174
? buildMaterialPreviewURL ( getBrandingConfig ( state ) ?. favicon ! )
195
175
: favicon ,
@@ -201,7 +181,6 @@ const mapDispatchToProps = (dispatch: any) => ({
201
181
dispatch ( fetchUserAction ( ) ) ;
202
182
} ,
203
183
fetchConfig : ( orgId ?: string ) => dispatch ( fetchConfigAction ( orgId ) ) ,
204
- fetchHome : ( ) => dispatch ( fetchHomeData ( { } ) ) ,
205
184
} ) ;
206
185
207
186
const AppIndexWithProps = connect ( mapStateToProps , mapDispatchToProps ) ( AppIndex ) ;
0 commit comments