File tree Expand file tree Collapse file tree 3 files changed +16
-8
lines changed
Content/private-components/ViewWrapper/private-components
LeftSettingsPanel/private-components Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -35,10 +35,11 @@ export class AtomStoreMaster {
3535 return atomStore ;
3636 }
3737
38- getAtomStoreForModuleInstance ( moduleInstanceId : string ) : AtomStore {
38+ getAtomStoreForModuleInstance ( moduleInstanceId : string ) : AtomStore | null {
3939 const atomStore = this . _atomStores . get ( moduleInstanceId ) ;
4040 if ( ! atomStore ) {
41- throw new Error ( `No atom store found for module instance with id: ${ moduleInstanceId } ` ) ;
41+ console . debug ( `No atom store found for module instance with id ${ moduleInstanceId } ` ) ;
42+ return null ;
4243 }
4344 return atomStore ;
4445 }
Original file line number Diff line number Diff line change @@ -38,8 +38,6 @@ export const ViewContent = React.memo((props: ViewContentProps) => {
3838 ModuleInstanceTopic . HAS_INVALID_PERSISTED_VIEW ,
3939 ) ;
4040
41- const atomStore = workbenchSession . getAtomStoreMaster ( ) . getAtomStoreForModuleInstance ( props . moduleInstance . getId ( ) ) ;
42-
4341 const handleModuleInstanceReload = React . useCallback (
4442 function handleModuleInstanceReload ( ) {
4543 props . moduleInstance . reset ( ) ;
@@ -127,6 +125,11 @@ export const ViewContent = React.memo((props: ViewContentProps) => {
127125 }
128126 }
129127
128+ const atomStore = workbenchSession . getAtomStoreMaster ( ) . getAtomStoreForModuleInstance ( props . moduleInstance . getId ( ) ) ;
129+ if ( ! atomStore ) {
130+ return null ;
131+ }
132+
130133 const View = props . moduleInstance . getViewFC ( ) ;
131134 return (
132135 < ErrorBoundary moduleInstance = { props . moduleInstance } >
Original file line number Diff line number Diff line change @@ -49,10 +49,6 @@ export const ModuleSettings: React.FC<ModuleSettingsProps> = (props) => {
4949
5050 const isSerializable = props . moduleInstance . getModule ( ) . canBeSerialized ( ) ;
5151
52- const atomStore = workbenchSession !
53- . getAtomStoreMaster ( )
54- . getAtomStoreForModuleInstance ( props . moduleInstance . getId ( ) ) ;
55-
5652 if ( importState !== ImportStatus . Imported || ! props . moduleInstance . isInitialized ( ) ) {
5753 return null ;
5854 }
@@ -105,6 +101,14 @@ export const ModuleSettings: React.FC<ModuleSettingsProps> = (props) => {
105101 ) ;
106102 }
107103
104+ const atomStore = workbenchSession
105+ . getAtomStoreMaster ( )
106+ . getAtomStoreForModuleInstance ( props . moduleInstance . getId ( ) ) ;
107+
108+ if ( ! atomStore ) {
109+ return null ;
110+ }
111+
108112 return (
109113 < >
110114 { ! isSerializable && (
You can’t perform that action at this time.
0 commit comments