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() {
9696 } , [ currentUser . currentOrgId ] )
9797
9898 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+ } ;
102111
103112 useEffect ( ( ) => {
104113 setSettings ( commonSettings ) ;
@@ -176,6 +185,9 @@ export function AdvancedSetting() {
176185 onChange = { ( value : string ) => {
177186 setSettings ( ( v ) => ( { ...v , defaultHomePage : value } ) ) ;
178187 } }
188+ onDropdownVisibleChange = { ( open ) => {
189+ if ( open ) handleDropdownOpen ( ) ;
190+ } }
179191 options = { appListOptions }
180192 filterOption = { ( input , option ) => ( option ?. label as string ) . includes ( input ) }
181193 />
You can’t perform that action at this time.
0 commit comments