File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
packages/compas-open-scd/src Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -141,9 +141,8 @@ export class OpenSCD extends LitElement {
141141 this . compasApi = {
142142 lNodeLibrary : {
143143 loadLNodeLibrary : async ( ) => {
144- if ( this . _lNodeLibrary ) return this . _lNodeLibrary ;
145- this . _lNodeLibrary = await this . loadLNodeLibrary ( ) ;
146- return this . _lNodeLibrary ;
144+ const doc = await this . loadLNodeLibrary ( ) ;
145+ return doc ;
147146 } ,
148147 lNodeLibrary : ( ) => this . _lNodeLibrary ,
149148 } ,
@@ -153,7 +152,11 @@ export class OpenSCD extends LitElement {
153152 private async loadLNodeLibrary ( ) : Promise < Document | null > {
154153 try {
155154 const doc = await CompasSclDataService ( ) . getSclDocument ( this , 'SSD' , LNODE_LIB_DOC_ID ) ;
156- return doc instanceof Document ? doc : null ;
155+ if ( doc instanceof Document ) {
156+ this . _lNodeLibrary = doc ;
157+ return doc ;
158+ }
159+ return null ;
157160 } catch ( reason ) {
158161 createLogEvent ( this , reason ) ;
159162 return null ;
You can’t perform that action at this time.
0 commit comments