Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit52fe548

Browse files
committed
[Fix]:#1849 optimize api calls for advanced setting page
1 parent64b7f58 commit52fe548

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

‎client/packages/lowcoder/src/pages/setting/advanced/AdvancedSetting.tsx‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff 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+
consthandleDropdownOpen=()=>{
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?.labelasstring).includes(input)}
181193
/>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp