Skip to content

Commit 896c0d0

Browse files
authored
Merge pull request #680 from linthan/cleanconfiglist
fix: 用户切换应用 → appName 或 env 变化
2 parents e0626b3 + e81dde6 commit 896c0d0

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

  • assets/src/pages/app/components/Config

assets/src/pages/app/components/Config/index.jsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ function ConfigEdit(props) {
1717
if (!appName) return;
1818
if (!env) return;
1919

20+
// 立即清空配置数据,避免显示旧数据
21+
props.dispatch({
22+
type: 'config/_apply',
23+
payload: {
24+
configList: [],
25+
configListLoading: true,
26+
},
27+
});
28+
2029
// reset
2130
props.dispatch({
2231
type: 'config/showEditorMaskLayer',
@@ -29,6 +38,10 @@ function ConfigEdit(props) {
2938
payload: 'config-edit',
3039
});
3140

41+
props.dispatch({
42+
type: 'config/clearCurrentConfig',
43+
});
44+
3245
// load config-file list
3346
props.dispatch({
3447
type: 'config/loadConfigInfo',
@@ -37,10 +50,6 @@ function ConfigEdit(props) {
3750
env,
3851
},
3952
});
40-
41-
props.dispatch({
42-
type: 'config/clearCurrentConfig',
43-
});
4453
}, [appName, env]);
4554

4655
useEffect(() => {

0 commit comments

Comments
 (0)