File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
client/packages/lowcoder/src/comps Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff 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 /**
You can’t perform that action at this time.
0 commit comments