Skip to content

Commit 7b738c3

Browse files
Merge pull request #2031 from iamfaran/fix/2020-layers
[Fix]: #2020 dynamic layers issue
2 parents f0fca07 + 8851f94 commit 7b738c3

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

client/packages/lowcoder/src/comps/comps/rootComp.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const RootView = React.memo((props: RootViewProps) => {
100100
return (oldState ? changeEditorStateFn(oldState) : undefined)
101101
});
102102
}
103-
});
103+
}, undefined, isModuleRoot);
104104
editorStateRef.current = newEditorState;
105105
setEditorState(newEditorState);
106106

@@ -109,7 +109,7 @@ const RootView = React.memo((props: RootViewProps) => {
109109
editorStateRef.current = undefined;
110110
}
111111
};
112-
}, []);
112+
}, [isModuleRoot]);
113113

114114
useEffect(() => {
115115
if (!mountedRef.current || !editorState) return;

client/packages/lowcoder/src/comps/editorState.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,17 @@ export class EditorState {
7070
rootComp: RootComp,
7171
setEditorState: (fn: (editorState: EditorState) => EditorState) => void,
7272
initialEditorModeStatus: string = getEditorModeStatus(),
73+
isModuleRoot: boolean = false,
7374
) {
7475
this.rootComp = rootComp;
7576
this.setEditorState = setEditorState;
7677
this.editorModeStatus = initialEditorModeStatus;
7778

7879
// save collision status from app dsl to localstorage
79-
saveCollisionStatus(this.getCollisionStatus());
80+
// but only for apps, not for modules (to prevent modules from overwriting the app's setting)
81+
if (!isModuleRoot) {
82+
saveCollisionStatus(this.getCollisionStatus());
83+
}
8084
}
8185

8286
/**

0 commit comments

Comments
 (0)