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) => {
100
100
return ( oldState ? changeEditorStateFn ( oldState ) : undefined )
101
101
} ) ;
102
102
}
103
- } ) ;
103
+ } , undefined , isModuleRoot ) ;
104
104
editorStateRef . current = newEditorState ;
105
105
setEditorState ( newEditorState ) ;
106
106
@@ -109,7 +109,7 @@ const RootView = React.memo((props: RootViewProps) => {
109
109
editorStateRef . current = undefined ;
110
110
}
111
111
} ;
112
- } , [ ] ) ;
112
+ } , [ isModuleRoot ] ) ;
113
113
114
114
useEffect ( ( ) => {
115
115
if ( ! mountedRef . current || ! editorState ) return ;
Original file line number Diff line number Diff line change @@ -70,13 +70,17 @@ export class EditorState {
70
70
rootComp : RootComp ,
71
71
setEditorState : ( fn : ( editorState : EditorState ) => EditorState ) => void ,
72
72
initialEditorModeStatus : string = getEditorModeStatus ( ) ,
73
+ isModuleRoot : boolean = false ,
73
74
) {
74
75
this . rootComp = rootComp ;
75
76
this . setEditorState = setEditorState ;
76
77
this . editorModeStatus = initialEditorModeStatus ;
77
78
78
79
// 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
+ }
80
84
}
81
85
82
86
/**
You can’t perform that action at this time.
0 commit comments