File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
client/packages/lowcoder/src/pages/setting/advanced Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -96,9 +96,18 @@ export function AdvancedSetting() {
96
96
} , [ currentUser . currentOrgId ] )
97
97
98
98
useEffect ( ( ) => {
99
- dispatch ( fetchCommonSettings ( { orgId : currentUser . currentOrgId } ) ) ;
100
- dispatch ( fetchAllApplications ( { } ) ) ;
101
- } , [ currentUser . currentOrgId , dispatch ] ) ;
99
+ // Only fetch common settings if not already loaded
100
+ if ( Object . keys ( commonSettings ) . length === 0 ) {
101
+ dispatch ( fetchCommonSettings ( { orgId : currentUser . currentOrgId } ) ) ;
102
+ }
103
+ } , [ currentUser . currentOrgId , dispatch , commonSettings ] ) ;
104
+
105
+ // Lazy load applications only when dropdown is opened
106
+ const handleDropdownOpen = ( ) => {
107
+ if ( appList . length === 0 ) {
108
+ dispatch ( fetchAllApplications ( { } ) ) ;
109
+ }
110
+ } ;
102
111
103
112
useEffect ( ( ) => {
104
113
setSettings ( commonSettings ) ;
@@ -176,6 +185,9 @@ export function AdvancedSetting() {
176
185
onChange = { ( value : string ) => {
177
186
setSettings ( ( v ) => ( { ...v , defaultHomePage : value } ) ) ;
178
187
} }
188
+ onDropdownVisibleChange = { ( open ) => {
189
+ if ( open ) handleDropdownOpen ( ) ;
190
+ } }
179
191
options = { appListOptions }
180
192
filterOption = { ( input , option ) => ( option ?. label as string ) . includes ( input ) }
181
193
/>
You can’t perform that action at this time.
0 commit comments